[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241128194300.87605-1-mlevitsk@redhat.com>
Date: Thu, 28 Nov 2024 14:43:00 -0500
From: Maxim Levitsky <mlevitsk@...hat.com>
To: kvm@...r.kernel.org
Cc: Shradha Gupta <shradhagupta@...ux.microsoft.com>,
Wei Liu <wei.liu@...nel.org>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Konstantin Taranov <kotaranov@...rosoft.com>,
Yury Norov <yury.norov@...il.com>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Eric Dumazet <edumazet@...gle.com>,
linux-hyperv@...r.kernel.org,
Long Li <longli@...rosoft.com>,
Jakub Kicinski <kuba@...nel.org>,
Maxim Levitsky <mlevitsk@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Leon Romanovsky <leon@...nel.org>,
netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Souradeep Chakrabarti <schakrabarti@...ux.microsoft.com>,
Dexuan Cui <decui@...rosoft.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] net: mana: Fix memory leak in mana_gd_setup_irqs
Commit 8afefc361209 ("net: mana: Assigning IRQ affinity on HT cores")
added memory allocation in mana_gd_setup_irqs of 'irqs' but the code
doesn't free this temporary array in the success path.
This was caught by kmemleak.
Fixes: 8afefc361209 ("net: mana: Assigning IRQ affinity on HT cores")
Signed-off-by: Maxim Levitsky <mlevitsk@...hat.com>
---
drivers/net/ethernet/microsoft/mana/gdma_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index e97af7ac2bb2..aba188f9f10f 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
@@ -1375,6 +1375,7 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
gc->max_num_msix = nvec;
gc->num_msix_usable = nvec;
cpus_read_unlock();
+ kfree(irqs);
return 0;
free_irq:
--
2.26.3
Powered by blists - more mailing lists