Skip to content

Commit f00e0d7

Browse files
William Deanmartinkpetersen
authored andcommitted
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/[email protected] Fixes: 3cee98d ("scsi: lpfc: Fix crash on driver unload in wq free") Reported-by: Hacash Robot <[email protected]> Reviewed-by: James Smart <[email protected]> Signed-off-by: William Dean <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 8fcdc23 commit f00e0d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7948,6 +7948,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
79487948

79497949
/* The lpfc_wq workqueue for deferred irq use */
79507950
phba->wq = alloc_workqueue("lpfc_wq", WQ_MEM_RECLAIM, 0);
7951+
if (!phba->wq)
7952+
return -ENOMEM;
79517953

79527954
/*
79537955
* Initialize timers used by driver

0 commit comments

Comments
 (0)