projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23211c1
)
cxlflash: a couple off by one bugs
author
Dan Carpenter
<
[email protected]
>
Wed, 2 Dec 2015 23:26:28 +0000
(17:26 -0600)
committer
Martin K. Petersen
<
[email protected]
>
Thu, 10 Dec 2015 17:53:52 +0000
(12:53 -0500)
The "> MAX_CONTEXT" should be ">= MAX_CONTEXT". Otherwise we go one
step beyond the end of the cfg->ctx_tbl[] array.
Signed-off-by: Dan Carpenter <
[email protected]
>
Reviewed-by: Manoj Kumar <
[email protected]
>
Reviewed-by: Johannes Thumshirn <
[email protected]
>
Acked-by: Matthew R. Ochs <
[email protected]
>
Signed-off-by: Martin K. Petersen <
[email protected]
>
drivers/scsi/cxlflash/superpipe.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/cxlflash/superpipe.c
b/drivers/scsi/cxlflash/superpipe.c
index cac2e6a50efd83ab001bdb84cf56fb2d8d1d35b2..34b21a0a926a04bc09e2025786d00c3736bbd612 100644
(file)
--- a/
drivers/scsi/cxlflash/superpipe.c
+++ b/
drivers/scsi/cxlflash/superpipe.c
@@
-1380,7
+1380,7
@@
static int cxlflash_disk_attach(struct scsi_device *sdev,
}
ctxid = cxl_process_element(ctx);
- if (unlikely((ctxid > MAX_CONTEXT) || (ctxid < 0))) {
+ if (unlikely((ctxid >
=
MAX_CONTEXT) || (ctxid < 0))) {
dev_err(dev, "%s: ctxid (%d) invalid!\n", __func__, ctxid);
rc = -EPERM;
goto err2;
@@
-1508,7
+1508,7
@@
static int recover_context(struct cxlflash_cfg *cfg, struct ctx_info *ctxi)
}
ctxid = cxl_process_element(ctx);
- if (unlikely((ctxid > MAX_CONTEXT) || (ctxid < 0))) {
+ if (unlikely((ctxid >
=
MAX_CONTEXT) || (ctxid < 0))) {
dev_err(dev, "%s: ctxid (%d) invalid!\n", __func__, ctxid);
rc = -EPERM;
goto err1;