From 0dc77769807b3f6858dd45c7ec255e46876905fa Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 8 Apr 2019 02:18:55 +0000 Subject: [PATCH] qla2x00t-32gbit: Free interrupts if memory allocation fails git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8172 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_isr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index 392634163..e02827fd5 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -3594,7 +3594,7 @@ msix_failed: 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; @@ -3688,6 +3688,14 @@ msix_out: kfree(entries); #endif return ret; + +free_irqs: +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) + pci_disable_msix(ha->pdev); +#else + pci_free_irq_vectors(ha->pdev); +#endif + goto msix_out; } int