aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index e72b4ad47d35..11bc3e1fbd5a 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -257,9 +257,11 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
257 itt_t itt; 257 itt_t itt;
258 int rc; 258 int rc;
259 259
260 rc = conn->session->tt->alloc_pdu(task, ISCSI_OP_SCSI_CMD); 260 if (conn->session->tt->alloc_pdu) {
261 if (rc) 261 rc = conn->session->tt->alloc_pdu(task, ISCSI_OP_SCSI_CMD);
262 return rc; 262 if (rc)
263 return rc;
264 }
263 hdr = (struct iscsi_cmd *) task->hdr; 265 hdr = (struct iscsi_cmd *) task->hdr;
264 itt = hdr->itt; 266 itt = hdr->itt;
265 memset(hdr, 0, sizeof(*hdr)); 267 memset(hdr, 0, sizeof(*hdr));
@@ -566,11 +568,14 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
566 } else 568 } else
567 task->data_count = 0; 569 task->data_count = 0;
568 570
569 if (conn->session->tt->alloc_pdu(task, hdr->opcode)) { 571 if (conn->session->tt->alloc_pdu) {
570 iscsi_conn_printk(KERN_ERR, conn, "Could not allocate " 572 if (conn->session->tt->alloc_pdu(task, hdr->opcode)) {
571 "pdu for mgmt task.\n"); 573 iscsi_conn_printk(KERN_ERR, conn, "Could not allocate "
572 goto requeue_task; 574 "pdu for mgmt task.\n");
575 goto requeue_task;
576 }
573 } 577 }
578
574 itt = task->hdr->itt; 579 itt = task->hdr->itt;
575 task->hdr_len = sizeof(struct iscsi_hdr); 580 task->hdr_len = sizeof(struct iscsi_hdr);
576 memcpy(task->hdr, hdr, sizeof(struct iscsi_hdr)); 581 memcpy(task->hdr, hdr, sizeof(struct iscsi_hdr));