summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohan.kallickal@emulex.com>2011-10-08 04:31:10 +0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-16 20:03:19 +0400
commitbd5354511d00cb9c81c64b0544786807a2209488 (patch)
tree4b6c293978decaa611a86c1c49fb6e477c88fe60 /drivers/scsi
parent685e16fdcf4324fe75ff28940311598f01704eaa (diff)
downloadlinux-bd5354511d00cb9c81c64b0544786807a2209488.tar.xz
[SCSI] be2iscsi: Fix for case where task->sc was cleanedup earlier
This patch fixes a bug where the task->sc was cleaned up earlier on a different thread, possibly abort, and the completion comes later. This was causing a crash which has been reported in multiple places Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/be2iscsi/be_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index e166d547a341..7b0a8ab71049 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1123,7 +1123,12 @@ be_complete_io(struct beiscsi_conn *beiscsi_conn,
& SOL_STS_MASK) >> 8);
flags = ((psol->dw[offsetof(struct amap_sol_cqe, i_flags) / 32]
& SOL_FLAGS_MASK) >> 24) | 0x80;
+ if (!task->sc) {
+ if (io_task->scsi_cmnd)
+ scsi_dma_unmap(io_task->scsi_cmnd);
+ return;
+ }
task->sc->result = (DID_OK << 16) | status;
if (rsp != ISCSI_STATUS_CMD_COMPLETED) {
task->sc->result = DID_ERROR << 16;