Skip to content

Commit e0a8e18

Browse files
committed
net: mana: Fix irq_contexts memory leak in mana_gd_setup_irqs
jira LE-3460 Rebuild_History Non-Buildable kernel-6.12.0-55.11.1.el10_0 commit-author Maxim Levitsky <[email protected]> commit 9a5beb6 gc->irq_contexts is not freeded if one of the later operations fail. Suggested-by: Michael Kelley <[email protected]> Fixes: 8afefc3 ("net: mana: Assigning IRQ affinity on HT cores") Signed-off-by: Maxim Levitsky <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Reviewed-by: Saurabh Sengar <[email protected]> Reviewed-by: Yury Norov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 9a5beb6) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 6b72fdc commit e0a8e18

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/microsoft/mana/gdma_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
13181318
GFP_KERNEL);
13191319
if (!gc->irq_contexts) {
13201320
err = -ENOMEM;
1321-
goto free_irq_vector;
1321+
goto free_irq_array;
13221322
}
13231323

13241324
for (i = 0; i < nvec; i++) {
@@ -1388,8 +1388,9 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
13881388
}
13891389

13901390
kfree(gc->irq_contexts);
1391-
kfree(irqs);
13921391
gc->irq_contexts = NULL;
1392+
free_irq_array:
1393+
kfree(irqs);
13931394
free_irq_vector:
13941395
cpus_read_unlock();
13951396
pci_free_irq_vectors(pdev);

0 commit comments

Comments
 (0)