bnx2i: Fixed packet error created when the sq_size is set to 16
[linux-flexiantxendom0-natty.git] / drivers / scsi / bnx2i / bnx2i_iscsi.c
index f0dce26..204d962 100644 (file)
@@ -1205,6 +1205,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
         */