Patch "net: mana: Fix irq_contexts memory leak in mana_gd_setup_irqs" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: mana: Fix irq_contexts memory leak in mana_gd_setup_irqs

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-mana-fix-irq_contexts-memory-leak-in-mana_gd_set.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1e2f200da3fcfa42aa841664c51dbbe233418464
Author: Maxim Levitsky <mlevitsk@xxxxxxxxxx>
Date:   Mon Dec 9 12:57:51 2024 -0500

    net: mana: Fix irq_contexts memory leak in mana_gd_setup_irqs
    
    [ Upstream commit 9a5beb6ca6305de5c5210efab0702ea79b62eb39 ]
    
    gc->irq_contexts is not freeded if one of the later operations
    fail.
    
    Suggested-by: Michael Kelley <mhklinux@xxxxxxxxxxx>
    Fixes: 8afefc361209 ("net: mana: Assigning IRQ affinity on HT cores")
    Signed-off-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx>
    Reviewed-by: Michal Swiatkowski <michal.swiatkowski@xxxxxxxxxxxxxxx>
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@xxxxxxxxxxxx>
    Reviewed-by: Saurabh Sengar <ssengar@xxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Yury Norov <yury.norov@xxxxxxxxx>
    Link: https://patch.msgid.link/20241209175751.287738-3-mlevitsk@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index 42076c90ce87..0c2ba2fa88c4 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
@@ -1315,7 +1315,7 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
 				   GFP_KERNEL);
 	if (!gc->irq_contexts) {
 		err = -ENOMEM;
-		goto free_irq_vector;
+		goto free_irq_array;
 	}
 
 	for (i = 0; i < nvec; i++) {
@@ -1385,8 +1385,9 @@ static int mana_gd_setup_irqs(struct pci_dev *pdev)
 	}
 
 	kfree(gc->irq_contexts);
-	kfree(irqs);
 	gc->irq_contexts = NULL;
+free_irq_array:
+	kfree(irqs);
 free_irq_vector:
 	cpus_read_unlock();
 	pci_free_irq_vectors(pdev);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux