diff options
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index c989bc6180b3..03b3dee49009 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -360,6 +360,10 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, | |||
360 | 360 | ||
361 | switch(opcode) { | 361 | switch(opcode) { |
362 | case ISCSI_OP_LOGOUT_RSP: | 362 | case ISCSI_OP_LOGOUT_RSP: |
363 | if (datalen) { | ||
364 | rc = ISCSI_ERR_PROTO; | ||
365 | break; | ||
366 | } | ||
363 | conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1; | 367 | conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1; |
364 | /* fall through */ | 368 | /* fall through */ |
365 | case ISCSI_OP_LOGIN_RSP: | 369 | case ISCSI_OP_LOGIN_RSP: |
@@ -383,7 +387,7 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, | |||
383 | iscsi_tmf_rsp(conn, hdr); | 387 | iscsi_tmf_rsp(conn, hdr); |
384 | break; | 388 | break; |
385 | case ISCSI_OP_NOOP_IN: | 389 | case ISCSI_OP_NOOP_IN: |
386 | if (hdr->ttt != ISCSI_RESERVED_TAG) { | 390 | if (hdr->ttt != ISCSI_RESERVED_TAG || datalen) { |
387 | rc = ISCSI_ERR_PROTO; | 391 | rc = ISCSI_ERR_PROTO; |
388 | break; | 392 | break; |
389 | } | 393 | } |
@@ -1405,7 +1409,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, uint32_t conn_idx) | |||
1405 | data = kmalloc(DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH, GFP_KERNEL); | 1409 | data = kmalloc(DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH, GFP_KERNEL); |
1406 | if (!data) | 1410 | if (!data) |
1407 | goto login_mtask_data_alloc_fail; | 1411 | goto login_mtask_data_alloc_fail; |
1408 | conn->login_mtask->data = data; | 1412 | conn->login_mtask->data = conn->data = data; |
1409 | 1413 | ||
1410 | init_timer(&conn->tmabort_timer); | 1414 | init_timer(&conn->tmabort_timer); |
1411 | mutex_init(&conn->xmitmutex); | 1415 | mutex_init(&conn->xmitmutex); |
@@ -1477,7 +1481,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn) | |||
1477 | } | 1481 | } |
1478 | 1482 | ||
1479 | spin_lock_bh(&session->lock); | 1483 | spin_lock_bh(&session->lock); |
1480 | kfree(conn->login_mtask->data); | 1484 | kfree(conn->data); |
1481 | __kfifo_put(session->mgmtpool.queue, (void*)&conn->login_mtask, | 1485 | __kfifo_put(session->mgmtpool.queue, (void*)&conn->login_mtask, |
1482 | sizeof(void*)); | 1486 | sizeof(void*)); |
1483 | list_del(&conn->item); | 1487 | list_del(&conn->item); |