Skip to content

Commit

Permalink
scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset()
Browse files Browse the repository at this point in the history
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/[email protected]
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 <[email protected]>
Signed-off-by: SeongJae Park <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
sj-aws authored and martinkpetersen committed Jun 24, 2020
1 parent aad4b4d commit 46da547
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -11878,7 +11878,8 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba)
lpfc_sli4_xri_exchange_busy_wait(phba);

/* per-phba callback de-registration for hotplug event */
lpfc_cpuhp_remove(phba);
if (phba->pport)
lpfc_cpuhp_remove(phba);

/* Disable PCI subsystem interrupt */
lpfc_sli4_disable_intr(phba);
Expand Down

0 comments on commit 46da547

Please sign in to comment.