Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0e7be0d authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman
Browse files

scsi: lpfc: Add missing destroy_workqueue() in error path

commit da6d507f5ff328f346b3c50e19e19993027b8ffd 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: 3cee98db ("scsi: lpfc: Fix crash on driver unload in wq free")
Reviewed-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5682c946
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -6537,7 +6537,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) >=
@@ -6911,6 +6911,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;
}