Skip to content

Commit 5633a0c

Browse files
committed
net: mana: Fix irq_contexts memory leak in mana_gd_setup_irqs
jira NONE_AUTOMATION Rebuild_History Non-Buildable kernel-5.14.0-570.16.1.el9_6 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 9849c29 commit 5633a0c

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
@@ -1317,7 +1317,7 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
13171317
GFP_KERNEL);
13181318
if (!gc->irq_contexts) {
13191319
err = -ENOMEM;
1320-
goto free_irq_vector;
1320+
goto free_irq_array;
13211321
}
13221322

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

13891389
kfree(gc->irq_contexts);
1390-
kfree(irqs);
13911390
gc->irq_contexts = NULL;
1391+
free_irq_array:
1392+
kfree(irqs);
13921393
free_irq_vector:
13931394
cpus_read_unlock();
13941395
pci_free_irq_vectors(pdev);

0 commit comments

Comments
 (0)