Skip to content

Commit

Permalink
[SCSI] be2iscsi: Fix for case where task->sc was cleanedup earlier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jayamohan Kallickal authored and James Bottomley committed Oct 16, 2011
1 parent 685e16f commit bd53545
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/scsi/be2iscsi/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bd53545

Please sign in to comment.