Skip to content

Commit e34b1e8

Browse files
Maxim Levitskymehmetb0
authored andcommitted
net: mana: Fix irq_contexts memory leak in mana_gd_setup_irqs
BugLink: https://bugs.launchpad.net/bugs/2097332 [ Upstream 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Koichiro Den <[email protected]>
1 parent 2821734 commit e34b1e8

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
@@ -1315,7 +1315,7 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
13151315
GFP_KERNEL);
13161316
if (!gc->irq_contexts) {
13171317
err = -ENOMEM;
1318-
goto free_irq_vector;
1318+
goto free_irq_array;
13191319
}
13201320

13211321
for (i = 0; i < nvec; i++) {
@@ -1385,8 +1385,9 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
13851385
}
13861386

13871387
kfree(gc->irq_contexts);
1388-
kfree(irqs);
13891388
gc->irq_contexts = NULL;
1389+
free_irq_array:
1390+
kfree(irqs);
13901391
free_irq_vector:
13911392
cpus_read_unlock();
13921393
pci_free_irq_vectors(pdev);

0 commit comments

Comments
 (0)