From f750ece8349ad34a3b3b92d768fe74710e4d07cb Mon Sep 17 00:00:00 2001 From: Himanshu Madhani Date: Thu, 1 Aug 2019 15:55:50 -0400 Subject: [PATCH 090/124] [scsi] scsi: qla2xxx: Fix a qla24xx_enable_msix() error path Message-id: <20190801155618.12650-91-hmadhani@redhat.com> Patchwork-id: 267885 O-Subject: [RHEL 7.8 e-stor PATCH 090/118] scsi: qla2xxx: Fix a qla24xx_enable_msix() error path Bugzilla: 1729270 RH-Acked-by: Jarod Wilson RH-Acked-by: Tony Camuso From: Bart Van Assche Bugzilla 1729270 Make sure that the allocated interrupts are freed if allocating memory for the msix_entries array fails. Cc: Himanshu Madhani Cc: Giridhar Malavali Signed-off-by: Bart Van Assche Acked-by: Himanshu Madhani Signed-off-by: Martin K. Petersen (cherry picked from commit 24afabdbd0b3553963a2bbf465895492b14d1107) Signed-off-by: Himanshu Madhani Signed-off-by: Jan Stancek --- drivers/scsi/qla2xxx/qla_isr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index f099a812e29f..7c58e04c5d70 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -3495,7 +3495,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; @@ -3578,6 +3578,10 @@ msix_register_fail: msix_out: return ret; + +free_irqs: + pci_free_irq_vectors(ha->pdev); + goto msix_out; } int -- 2.13.6