summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2015-04-07 15:07:25 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-04-10 07:50:03 -0700
commit6c7cf486d35e0441c81f9bb8c49e6c826028bbb6 (patch)
tree00e6a95f7c622639208f68ba80722050885c42a5 /drivers/scsi/lpfc/lpfc_sli.c
parent6eae430328d23e2d6adaa649a7c0bac18e04dda8 (diff)
downloadlinux-6c7cf486d35e0441c81f9bb8c49e6c826028bbb6.tar.gz
linux-6c7cf486d35e0441c81f9bb8c49e6c826028bbb6.tar.bz2
linux-6c7cf486d35e0441c81f9bb8c49e6c826028bbb6.zip
lpfc: Fix OS crash when running loopback test in applications
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index c76c2a1e41e4..48919d0e31c7 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -918,12 +918,16 @@ __lpfc_sli_get_sglq(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq)
lpfc_cmd = (struct lpfc_scsi_buf *) piocbq->context1;
ndlp = lpfc_cmd->rdata->pnode;
} else if ((piocbq->iocb.ulpCommand == CMD_GEN_REQUEST64_CR) &&
- !(piocbq->iocb_flag & LPFC_IO_LIBDFC))
+ !(piocbq->iocb_flag & LPFC_IO_LIBDFC)) {
ndlp = piocbq->context_un.ndlp;
- else if (piocbq->iocb_flag & LPFC_IO_LIBDFC)
- ndlp = piocbq->context_un.ndlp;
- else
+ } else if (piocbq->iocb_flag & LPFC_IO_LIBDFC) {
+ if (piocbq->iocb_flag & LPFC_IO_LOOPBACK)
+ ndlp = NULL;
+ else
+ ndlp = piocbq->context_un.ndlp;
+ } else {
ndlp = piocbq->context1;
+ }
list_remove_head(lpfc_sgl_list, sglq, struct lpfc_sglq, list);
start_sglq = sglq;