Patch "ixgbevf: Fix resource leak in ixgbevf_init_module()" has been added to the 6.0-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

    ixgbevf: Fix resource leak in ixgbevf_init_module()

to the 6.0-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:
     ixgbevf-fix-resource-leak-in-ixgbevf_init_module.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 390ccc57a269ff3955ade14ce1234e8860f43e61
Author: Shang XiaoJing <shangxiaojing@xxxxxxxxxx>
Date:   Mon Nov 14 10:57:58 2022 +0800

    ixgbevf: Fix resource leak in ixgbevf_init_module()
    
    [ Upstream commit 8cfa238a48f34038464b99d0b4825238c2687181 ]
    
    ixgbevf_init_module() won't destroy the workqueue created by
    create_singlethread_workqueue() when pci_register_driver() failed. Add
    destroy_workqueue() in fail path to prevent the resource leak.
    
    Similar to the handling of u132_hcd_init in commit f276e002793c
    ("usb: u132-hcd: fix resource leak")
    
    Fixes: 40a13e2493c9 ("ixgbevf: Use a private workqueue to avoid certain possible hangs")
    Signed-off-by: Shang XiaoJing <shangxiaojing@xxxxxxxxxx>
    Reviewed-by: Saeed Mahameed <saeed@xxxxxxxxxx>
    Tested-by: Konrad Jankowski <konrad0.jankowski@xxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 2f12fbe229c1..624b8aa4508c 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -4869,6 +4869,8 @@ static struct pci_driver ixgbevf_driver = {
  **/
 static int __init ixgbevf_init_module(void)
 {
+	int err;
+
 	pr_info("%s\n", ixgbevf_driver_string);
 	pr_info("%s\n", ixgbevf_copyright);
 	ixgbevf_wq = create_singlethread_workqueue(ixgbevf_driver_name);
@@ -4877,7 +4879,13 @@ static int __init ixgbevf_init_module(void)
 		return -ENOMEM;
 	}
 
-	return pci_register_driver(&ixgbevf_driver);
+	err = pci_register_driver(&ixgbevf_driver);
+	if (err) {
+		destroy_workqueue(ixgbevf_wq);
+		return err;
+	}
+
+	return 0;
 }
 
 module_init(ixgbevf_init_module);



[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