summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-08-25 13:36:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-27 15:43:17 +0300
commit9e071695a5be9ca758cc5c1d1b92ee98c4e8df1a (patch)
tree2725e3c1a7ebaf7c085d7d445ce1eae653dbb5be
parent71a9bae9b92ef5eb16d3c8f23129e22e812cc3bf (diff)
downloadlinux-9e071695a5be9ca758cc5c1d1b92ee98c4e8df1a.tar.xz
scsi: qedi: off by one in qedi_get_cmd_from_tid()
commit fa2d9d6e894e096678a50ef0f65f7a8c3d8a40b8 upstream. 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.") 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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;