OSDN Git Service

scsi: lpfc: resolve static checker warning in lpfc_sli4_hba_unset
authorJames Smart <jsmart2021@gmail.com>
Mon, 4 Mar 2019 23:27:51 +0000 (15:27 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 7 Mar 2019 00:26:45 +0000 (19:26 -0500)
The patch that replaced io channels for hdw_queues now reports the
following static checker warning:

drivers/scsi/lpfc/lpfc_init.c:11136 lpfc_sli4_hba_unset()
 error: we previously assumed 'phba->pport' could be null (see line 11074)

Resolve by adding a pport NULL check.

[mkp: tag tweak]

Fixes: cdb42becdd40 ("scsi: lpfc: Replace io_channels for nvme and fcp with general hdw_queues per cpu"_
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c

index 3eb04c3..cd09b21 100644 (file)
@@ -11132,7 +11132,8 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba)
                lpfc_sli4_ras_dma_free(phba);
 
        /* Stop the SLI4 device port */
-       phba->pport->work_port_events = 0;
+       if (phba->pport)
+               phba->pport->work_port_events = 0;
 }
 
  /**