aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-08-14 23:35:25 +0300
committerJames Bottomley <JBottomley@Odin.com>2015-08-26 18:06:31 -0700
commit46c6d45d7875a0328258a574e376ae75f7b2a64b (patch)
tree53b1301b826c4d1385a50954859406830c649a79 /drivers/scsi
parentcxlflash: Virtual LUN support (diff)
downloadlinux-dev-46c6d45d7875a0328258a574e376ae75f7b2a64b.tar.xz
linux-dev-46c6d45d7875a0328258a574e376ae75f7b2a64b.zip
cxlflash: off by one bug in cxlflash_show_port_status()
The > should be >= or we read one element past the end of the array. Fixes: c21e0bbfc485 ('cxlflash: Base support for IBM CXL Flash Adapter') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/cxlflash/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 458ed838f83a..fde2ba9342dc 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -586,7 +586,7 @@ static ssize_t cxlflash_show_port_status(struct device *dev,
u64 *fc_regs;
rc = kstrtouint((attr->attr.name + 4), 10, &port);
- if (rc || (port > NUM_FC_PORTS))
+ if (rc || (port >= NUM_FC_PORTS))
return 0;
fc_regs = &afu->afu_map->global.fc_regs[port][0];