mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
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: c21e0bbfc4
('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>
This commit is contained in:
parent
2cb79266d6
commit
46c6d45d78
1 changed files with 1 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue