summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-11-09 14:52:19 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-01 09:04:47 +0100
commit032cf0ad6873a07309736806269b3bfd53040cae (patch)
tree95d5541537d535841563a660fc018679b20e424f /drivers
parent8f98d6449b098ac6a7e9626c625a6c5c3e13a790 (diff)
downloadlinux-stable-032cf0ad6873a07309736806269b3bfd53040cae.tar.gz
linux-stable-032cf0ad6873a07309736806269b3bfd53040cae.tar.bz2
linux-stable-032cf0ad6873a07309736806269b3bfd53040cae.zip
scsi: qla2xxx: edif: Fix off by one bug in qla_edif_app_getfcinfo()
[ Upstream commit e11e285b9cd132db21568b5d29c291f590841944 ] The > comparison needs to be >= to prevent accessing one element beyond the end of the app_reply->ports[] array. Link: https://lore.kernel.org/r/20211109115219.GE16587@kili Fixes: 7878f22a2e03 ("scsi: qla2xxx: edif: Add getfcinfo and statistic bsgs") Reviewed-by: Ewan D. Milne <emilne@redhat.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qla2xxx/qla_edif.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index 9240e788b011..a04693498dc0 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -865,7 +865,7 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
"APP request entry - portid=%06x.\n", tdid.b24);
/* Ran out of space */
- if (pcnt > app_req.num_ports)
+ if (pcnt >= app_req.num_ports)
break;
if (tdid.b24 != 0 && tdid.b24 != fcport->d_id.b24)