]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: qla2xxx: Fix a qla24xx_enable_msix() error path
authorBart Van Assche <bvanassche@acm.org>
Wed, 17 Apr 2019 21:44:24 +0000 (14:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:19 +0000 (06:43 -0700)
[ Upstream commit 24afabdbd0b3553963a2bbf465895492b14d1107 ]

Make sure that the allocated interrupts are freed if allocating memory for
the msix_entries array fails.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/qla2xxx/qla_isr.c

index 69bbea9239cc81e7c37bb21af78d7fd84e6471a7..add17843148dd3167325794e1b4ff01fd60aef18 100644 (file)
@@ -3475,7 +3475,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
                ql_log(ql_log_fatal, vha, 0x00c8,
                    "Failed to allocate memory for ha->msix_entries.\n");
                ret = -ENOMEM;
-               goto msix_out;
+               goto free_irqs;
        }
        ha->flags.msix_enabled = 1;
 
@@ -3558,6 +3558,10 @@ msix_register_fail:
 
 msix_out:
        return ret;
+
+free_irqs:
+       pci_free_irq_vectors(ha->pdev);
+       goto msix_out;
 }
 
 int