From 728d8e4dfdc6691cf0943104035b9ca6ded7a38e Mon Sep 17 00:00:00 2001 From: Chuck Anderson Date: Fri, 16 Dec 2011 20:07:40 -0800 Subject: [PATCH] be2iscsi 4.1.239.0 [PATCH 07/10] Fix for case where task->sc was cleanedup earlier Dec. 16, 2011 Oracle bugzilla 13257 Oracle bug 13465921 be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39) jayamohan.kallickal@emulex.com Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0) Comments from the patch headers: Commit ID : bd5354511d00cb9c81c64b0544786807a2209488 [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 --- be_main.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) Signed-off-by: Chuck Anderson --- drivers/scsi/be2iscsi/be_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 28fa5e0efd633..ba041420113bc 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -1176,7 +1176,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; -- 2.50.1