From: Dan Carpenter <dan.carpenter@oracle.com>
To: "James E.J. Bottomley" <JBottomley@odin.com>,
"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
Cc: Brian King <brking@linux.vnet.ibm.com>,
Michael Neuling <mikey@neuling.org>,
"Manoj N. Kumar" <manoj@linux.vnet.ibm.com>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] cxlflash: off by one bug in cxlflash_show_port_status()
Date: Fri, 14 Aug 2015 23:35:25 +0300 [thread overview]
Message-ID: <20150814203525.GA27158@mwanda> (raw)
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>
Fixes: c21e0bbfc485 ('cxlflash: Base support for IBM CXL Flash Adapter')
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 0720d2f..fd70101 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -539,7 +539,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];
next reply other threads:[~2015-08-14 20:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-14 20:35 Dan Carpenter [this message]
2015-08-16 2:52 ` [patch] cxlflash: off by one bug in cxlflash_show_port_status() Matthew R. Ochs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150814203525.GA27158@mwanda \
--to=dan.carpenter@oracle.com \
--cc=JBottomley@odin.com \
--cc=brking@linux.vnet.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=manoj@linux.vnet.ibm.com \
--cc=mikey@neuling.org \
--cc=mrochs@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox