Skip to content

Commit 46da547

Browse files
sj-awsmartinkpetersen
authored andcommitted
scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset()
Commit cdb42be ("scsi: lpfc: Replace io_channels for nvme and fcp with general hdw_queues per cpu") has introduced static checker warnings for potential null dereferences in 'lpfc_sli4_hba_unset()' and commit 1ffdd2c ("scsi: lpfc: resolve static checker warning in lpfc_sli4_hba_unset") has tried to fix it. However, yet another potential null dereference is remaining. This commit fixes it. This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc. Link: https://lore.kernel.org/r/20200623084122.30633-1-sjpark@amazon.com Fixes: 1ffdd2c ("scsi: lpfc: resolve static checker warning inlpfc_sli4_hba_unset") Fixes: cdb42be ("scsi: lpfc: Replace io_channels for nvme and fcp with general hdw_queues per cpu") Reviewed-by: James Smart <james.smart@broadcom.com> Signed-off-by: SeongJae Park <sjpark@amazon.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent aad4b4d commit 46da547

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/scsi/lpfc/lpfc_init.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11878,7 +11878,8 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba)
1187811878
lpfc_sli4_xri_exchange_busy_wait(phba);
1187911879

1188011880
/* per-phba callback de-registration for hotplug event */
11881-
lpfc_cpuhp_remove(phba);
11881+
if (phba->pport)
11882+
lpfc_cpuhp_remove(phba);
1188211883

1188311884
/* Disable PCI subsystem interrupt */
1188411885
lpfc_sli4_disable_intr(phba);

0 commit comments

Comments
 (0)