|
@@ -385,9 +385,10 @@ qla2x00_start_scsi(srb_t *sp)
|
|
|
else
|
|
|
req->cnt = req->length -
|
|
|
(req->ring_index - cnt);
|
|
|
+ /* If still no head room then bail out */
|
|
|
+ if (req->cnt < (req_cnt + 2))
|
|
|
+ goto queuing_error;
|
|
|
}
|
|
|
- if (req->cnt < (req_cnt + 2))
|
|
|
- goto queuing_error;
|
|
|
|
|
|
/* Build command packet */
|
|
|
req->current_outstanding_cmd = handle;
|
|
@@ -1502,9 +1503,9 @@ qla24xx_start_scsi(srb_t *sp)
|
|
|
else
|
|
|
req->cnt = req->length -
|
|
|
(req->ring_index - cnt);
|
|
|
+ if (req->cnt < (req_cnt + 2))
|
|
|
+ goto queuing_error;
|
|
|
}
|
|
|
- if (req->cnt < (req_cnt + 2))
|
|
|
- goto queuing_error;
|
|
|
|
|
|
/* Build command packet. */
|
|
|
req->current_outstanding_cmd = handle;
|
|
@@ -1717,11 +1718,10 @@ qla24xx_dif_start_scsi(srb_t *sp)
|
|
|
else
|
|
|
req->cnt = req->length -
|
|
|
(req->ring_index - cnt);
|
|
|
+ if (req->cnt < (req_cnt + 2))
|
|
|
+ goto queuing_error;
|
|
|
}
|
|
|
|
|
|
- if (req->cnt < (req_cnt + 2))
|
|
|
- goto queuing_error;
|
|
|
-
|
|
|
status |= QDSS_GOT_Q_SPACE;
|
|
|
|
|
|
/* Build header part of command packet (excluding the OPCODE). */
|
|
@@ -2343,11 +2343,10 @@ sufficient_dsds:
|
|
|
else
|
|
|
req->cnt = req->length -
|
|
|
(req->ring_index - cnt);
|
|
|
+ if (req->cnt < (req_cnt + 2))
|
|
|
+ goto queuing_error;
|
|
|
}
|
|
|
|
|
|
- if (req->cnt < (req_cnt + 2))
|
|
|
- goto queuing_error;
|
|
|
-
|
|
|
ctx = sp->u.scmd.ctx =
|
|
|
mempool_alloc(ha->ctx_mempool, GFP_ATOMIC);
|
|
|
if (!ctx) {
|