summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qedi
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-08-25 13:36:57 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-08-28 22:12:39 -0400
commitfa2d9d6e894e096678a50ef0f65f7a8c3d8a40b8 (patch)
tree4a221ee623ee4de65d6ab07e7e0066270f7fe7d0 /drivers/scsi/qedi
parent47c4ccd3086139d2085e0f1e59c0f26e8ce4ff46 (diff)
downloadtalos-obmc-linux-fa2d9d6e894e096678a50ef0f65f7a8c3d8a40b8.tar.gz
talos-obmc-linux-fa2d9d6e894e096678a50ef0f65f7a8c3d8a40b8.zip
scsi: qedi: off by one in qedi_get_cmd_from_tid()
The > here should be >= or we end up reading one element beyond the end of the qedi->itt_map[] array. The qedi->itt_map[] array is allocated in qedi_alloc_itt(). Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") Cc: <stable@vger.kernel.org> # v4.10+ Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedi')
-rw-r--r--drivers/scsi/qedi/qedi_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index 2c3783684815..85e7bae4a7ef 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -1575,7 +1575,7 @@ struct qedi_cmd *qedi_get_cmd_from_tid(struct qedi_ctx *qedi, u32 tid)
{
struct qedi_cmd *cmd = NULL;
- if (tid > MAX_ISCSI_TASK_ENTRIES)
+ if (tid >= MAX_ISCSI_TASK_ENTRIES)
return NULL;
cmd = qedi->itt_map[tid].p_cmd;
OpenPOWER on IntegriCloud