]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
scsi: lpfc: fix: Coverity: lpfc_get_scsi_buf_s3(): Null pointer dereferences
authorJames Smart <jsmart2021@gmail.com>
Mon, 11 Nov 2019 23:03:56 +0000 (15:03 -0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 06:00:53 +0000 (01:00 -0500)
BugLink: https://bugs.launchpad.net/bugs/1862429
commit 6f23f8c5c9f1be4eb17c035129c80e49000c18a7 upstream.

Coverity reported the following:

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/scsi/lpfc/lpfc_scsi.c

index 1a8abc7f91d3ddd445149cebafcf815f4f439677..0babe637952476af0ff37f53dd4bc92f6e378a14 100644 (file)
@@ -767,7 +767,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;
        }