summaryrefslogtreecommitdiff
path: root/drivers/scsi/bnx2i/bnx2i_iscsi.c
diff options
context:
space:
mode:
authorEddie Wai <eddie.wai@broadcom.com>2011-05-16 18:13:18 (GMT)
committerJames Bottomley <jbottomley@parallels.com>2011-05-24 16:40:45 (GMT)
commit7287c63e986fe1a51a89f4bb1327320274a7a741 (patch)
treef9c712bc37bd16ed2437459c8989d868eeaf2112 /drivers/scsi/bnx2i/bnx2i_iscsi.c
parent6b278656f26707d410778d42cd6f789b5c53c41b (diff)
downloadlinux-fsl-qoriq-7287c63e986fe1a51a89f4bb1327320274a7a741.tar.xz
[SCSI] bnx2i: Fixed packet error created when the sq_size is set to 16
The number of chip's internal command cell, which is use to generate SCSI cmd packets to the target, was not initialized correctly by the driver when the sq_size is changed from the default 128. This, in turn, will create a problem where the chip's transmit pipe will erroneously reuse an old command cell that is no longer valid. The fix is to correctly initialize the chip's command cell upon setup. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Cc: stable@kernel.org Signed-off-by: James Bottomley <jbottomley@parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2i/bnx2i_iscsi.c')
-rw-r--r--drivers/scsi/bnx2i/bnx2i_iscsi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index 1809f9c..7b4d1d0 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -1208,6 +1208,9 @@ static int bnx2i_task_xmit(struct iscsi_task *task)
struct bnx2i_cmd *cmd = task->dd_data;
struct iscsi_cmd *hdr = (struct iscsi_cmd *) task->hdr;
+ if (bnx2i_conn->ep->num_active_cmds + 1 > hba->max_sqes)
+ return -ENOMEM;
+
/*
* If there is no scsi_cmnd this must be a mgmt task
*/