Skip to content

Commit 803dfd8

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Clean up allocated queues when queue setup mbox commands fail
lpfc_sli4_queue_setup() does not allocate memory and is used for submitting CREATE_QUEUE mailbox commands. Thus, if such mailbox commands fail we should clean up by also freeing the memory allocated for the queues with lpfc_sli4_queue_destroy(). Change the intended clean up label for the lpfc_sli4_queue_setup() error case to out_destroy_queue. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Message-ID: <20250915180811.137530-4-justintee8345@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent dcf5ea6 commit 803dfd8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8820,7 +8820,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
88208820
if (unlikely(rc)) {
88218821
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
88228822
"0381 Error %d during queue setup.\n", rc);
8823-
goto out_stop_timers;
8823+
goto out_destroy_queue;
88248824
}
88258825
/* Initialize the driver internal SLI layer lists. */
88268826
lpfc_sli4_setup(phba);
@@ -9103,7 +9103,6 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
91039103
lpfc_free_iocb_list(phba);
91049104
out_destroy_queue:
91059105
lpfc_sli4_queue_destroy(phba);
9106-
out_stop_timers:
91079106
lpfc_stop_hba_timers(phba);
91089107
out_free_mbox:
91099108
mempool_free(mboxq, phba->mbox_mem_pool);

0 commit comments

Comments
 (0)