Commit f00e0d77 authored by William Dean's avatar William Dean Committed by Martin K. Petersen

scsi: lpfc: Check the return value of alloc_workqueue()

The function alloc_workqueue() in lpfc_sli4_driver_resource_setup() can
fail, but there is no check of its return value. The return value should be
checked.

Link: https://lore.kernel.org/r/20220723064027.2956623-1-williamsukatube@163.com
Fixes: 3cee98db ("scsi: lpfc: Fix crash on driver unload in wq free")
Reported-by: default avatarHacash Robot <hacashRobot@santino.com>
Reviewed-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarWilliam Dean <williamsukatube@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8fcdc238
...@@ -7948,6 +7948,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) ...@@ -7948,6 +7948,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
/* The lpfc_wq workqueue for deferred irq use */ /* The lpfc_wq workqueue for deferred irq use */
phba->wq = alloc_workqueue("lpfc_wq", WQ_MEM_RECLAIM, 0); phba->wq = alloc_workqueue("lpfc_wq", WQ_MEM_RECLAIM, 0);
if (!phba->wq)
return -ENOMEM;
/* /*
* Initialize timers used by driver * Initialize timers used by driver
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment