aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/iscsi_tcp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index f12d605c7729..e6991515ad2e 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -642,9 +642,7 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
642 switch(conn->in.opcode) { 642 switch(conn->in.opcode) {
643 case ISCSI_OP_SCSI_CMD_RSP: 643 case ISCSI_OP_SCSI_CMD_RSP:
644 BUG_ON((void*)ctask != ctask->sc->SCp.ptr); 644 BUG_ON((void*)ctask != ctask->sc->SCp.ptr);
645 if (ctask->hdr.flags & ISCSI_FLAG_CMD_WRITE) 645 if (!conn->in.datalen)
646 rc = iscsi_cmd_rsp(conn, ctask);
647 else if (!conn->in.datalen)
648 rc = iscsi_cmd_rsp(conn, ctask); 646 rc = iscsi_cmd_rsp(conn, ctask);
649 else 647 else
650 /* 648 /*
@@ -666,8 +664,7 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
666 break; 664 break;
667 case ISCSI_OP_R2T: 665 case ISCSI_OP_R2T:
668 BUG_ON((void*)ctask != ctask->sc->SCp.ptr); 666 BUG_ON((void*)ctask != ctask->sc->SCp.ptr);
669 if (ctask->hdr.flags & ISCSI_FLAG_CMD_WRITE && 667 if (ctask->sc->sc_data_direction == DMA_TO_DEVICE)
670 ctask->sc->sc_data_direction == DMA_TO_DEVICE)
671 rc = iscsi_r2t_rsp(conn, ctask); 668 rc = iscsi_r2t_rsp(conn, ctask);
672 else 669 else
673 rc = ISCSI_ERR_PROTO; 670 rc = ISCSI_ERR_PROTO;