mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-20 01:20:54 +00:00
scsi: lpfc: Add missing destroy_workqueue() in error path
commitda6d507f5f
upstream. Add the missing destroy_workqueue() before return from lpfc_sli4_driver_resource_setup() in the error path. Link: https://lore.kernel.org/r/20220823044237.285643-1-yangyingliang@huawei.com Fixes:3cee98db26
("scsi: lpfc: Fix crash on driver unload in wq free") Reviewed-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6229fa494a
commit
1dcc308898
1 changed files with 4 additions and 1 deletions
|
@ -7893,7 +7893,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
|
|||
/* Allocate device driver memory */
|
||||
rc = lpfc_mem_alloc(phba, SGL_ALIGN_SZ);
|
||||
if (rc)
|
||||
return -ENOMEM;
|
||||
goto out_destroy_workqueue;
|
||||
|
||||
/* IF Type 2 ports get initialized now. */
|
||||
if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >=
|
||||
|
@ -8309,6 +8309,9 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
|
|||
lpfc_destroy_bootstrap_mbox(phba);
|
||||
out_free_mem:
|
||||
lpfc_mem_free(phba);
|
||||
out_destroy_workqueue:
|
||||
destroy_workqueue(phba->wq);
|
||||
phba->wq = NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue