]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: lpfc: Free phba irq in lpfc_sli4_enable_msi() when pci_irq_vector() fails
authorJustin Tee <justin.tee@broadcom.com>
Fri, 31 Jan 2025 00:05:20 +0000 (16:05 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 4 Feb 2025 02:53:22 +0000 (21:53 -0500)
Fix smatch warning regarding missed calls to free_irq().  Free the phba IRQ
in the failed pci_irq_vector cases.

lpfc_init.c: lpfc_sli4_enable_msi() warn: 'phba->pcidev->irq' from
             request_irq() not released.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20250131000524.163662-3-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c

index bcadf11414c8a41d6fc99d03586d55c26d0a6a0f..411a6b927c5b09aea56181489e929b88cafbd7c5 100644 (file)
@@ -13170,6 +13170,7 @@ lpfc_sli4_enable_msi(struct lpfc_hba *phba)
        eqhdl = lpfc_get_eq_hdl(0);
        rc = pci_irq_vector(phba->pcidev, 0);
        if (rc < 0) {
+               free_irq(phba->pcidev->irq, phba);
                pci_free_irq_vectors(phba->pcidev);
                lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
                                "0496 MSI pci_irq_vec failed (%d)\n", rc);
@@ -13250,6 +13251,7 @@ lpfc_sli4_enable_intr(struct lpfc_hba *phba, uint32_t cfg_mode)
                        eqhdl = lpfc_get_eq_hdl(0);
                        retval = pci_irq_vector(phba->pcidev, 0);
                        if (retval < 0) {
+                               free_irq(phba->pcidev->irq, phba);
                                lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
                                        "0502 INTR pci_irq_vec failed (%d)\n",
                                         retval);