diff options
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 7212fe95a66d..ecba606e6521 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -658,6 +658,8 @@ iscsi_r2t_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) | |||
658 | r2t->data_length = be32_to_cpu(rhdr->data_length); | 658 | r2t->data_length = be32_to_cpu(rhdr->data_length); |
659 | if (r2t->data_length == 0) { | 659 | if (r2t->data_length == 0) { |
660 | printk(KERN_ERR "iscsi_tcp: invalid R2T with zero data len\n"); | 660 | printk(KERN_ERR "iscsi_tcp: invalid R2T with zero data len\n"); |
661 | __kfifo_put(tcp_ctask->r2tpool.queue, (void*)&r2t, | ||
662 | sizeof(void*)); | ||
661 | spin_unlock(&session->lock); | 663 | spin_unlock(&session->lock); |
662 | return ISCSI_ERR_DATALEN; | 664 | return ISCSI_ERR_DATALEN; |
663 | } | 665 | } |
@@ -669,10 +671,12 @@ iscsi_r2t_rsp(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask) | |||
669 | 671 | ||
670 | r2t->data_offset = be32_to_cpu(rhdr->data_offset); | 672 | r2t->data_offset = be32_to_cpu(rhdr->data_offset); |
671 | if (r2t->data_offset + r2t->data_length > scsi_bufflen(ctask->sc)) { | 673 | if (r2t->data_offset + r2t->data_length > scsi_bufflen(ctask->sc)) { |
672 | spin_unlock(&session->lock); | ||
673 | printk(KERN_ERR "iscsi_tcp: invalid R2T with data len %u at " | 674 | printk(KERN_ERR "iscsi_tcp: invalid R2T with data len %u at " |
674 | "offset %u and total length %d\n", r2t->data_length, | 675 | "offset %u and total length %d\n", r2t->data_length, |
675 | r2t->data_offset, scsi_bufflen(ctask->sc)); | 676 | r2t->data_offset, scsi_bufflen(ctask->sc)); |
677 | __kfifo_put(tcp_ctask->r2tpool.queue, (void*)&r2t, | ||
678 | sizeof(void*)); | ||
679 | spin_unlock(&session->lock); | ||
676 | return ISCSI_ERR_DATALEN; | 680 | return ISCSI_ERR_DATALEN; |
677 | } | 681 | } |
678 | 682 | ||