Skip to content

Commit da6d507

Browse files
Yang Yingliangmartinkpetersen
authored andcommitted
scsi: lpfc: Add missing destroy_workqueue() in error path
Add the missing destroy_workqueue() before return from lpfc_sli4_driver_resource_setup() in the error path. Link: https://lore.kernel.org/r/[email protected] Fixes: 3cee98d ("scsi: lpfc: Fix crash on driver unload in wq free") Reviewed-by: James Smart <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c0a50cd commit da6d507

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8053,7 +8053,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
80538053
/* Allocate device driver memory */
80548054
rc = lpfc_mem_alloc(phba, SGL_ALIGN_SZ);
80558055
if (rc)
8056-
return -ENOMEM;
8056+
goto out_destroy_workqueue;
80578057

80588058
/* IF Type 2 ports get initialized now. */
80598059
if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >=
@@ -8481,6 +8481,9 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
84818481
lpfc_destroy_bootstrap_mbox(phba);
84828482
out_free_mem:
84838483
lpfc_mem_free(phba);
8484+
out_destroy_workqueue:
8485+
destroy_workqueue(phba->wq);
8486+
phba->wq = NULL;
84848487
return rc;
84858488
}
84868489

0 commit comments

Comments
 (0)