summaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2019-11-11 15:03:56 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-23 08:22:58 +0100
commite9866d5ed24f87dfc4a17bb4420d88e147644949 (patch)
tree7b3a382262fcddf35dcaeaeeff8e82f812c1c7e5 /drivers/scsi/lpfc
parent005d3275768a44f6559ef28b0d50fe3326d31dfe (diff)
scsi: lpfc: fix: Coverity: lpfc_get_scsi_buf_s3(): Null pointer dereferences
commit 6f23f8c5c9f1be4eb17c035129c80e49000c18a7 upstream. Coverity reported the following:
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index aa82d538a18a..40706cb842fd 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -719,7 +719,7 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp,
iocb->ulpLe = 1;
iocb->ulpClass = CLASS3;
- if (lpfc_ndlp_check_qdepth(phba, ndlp)) {
+ if (lpfc_ndlp_check_qdepth(phba, ndlp) && lpfc_cmd) {
atomic_inc(&ndlp->cmd_pending);
lpfc_cmd->flags |= LPFC_SBUF_BUMP_QDEPTH;
}