Patch "i40e: Fix error handling in i40e_init_module()" has been added to the 5.15-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

    i40e: Fix error handling in i40e_init_module()

to the 5.15-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:
     i40e-fix-error-handling-in-i40e_init_module.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 02ad4b17be21a2b3b35de2e7178c05fff026eea1
Author: Shang XiaoJing <shangxiaojing@xxxxxxxxxx>
Date:   Wed Nov 16 09:27:25 2022 +0800

    i40e: Fix error handling in i40e_init_module()
    
    [ Upstream commit 479dd06149425b9e00477f52200872587af76a48 ]
    
    i40e_init_module() won't free the debugfs directory created by
    i40e_dbg_init() when pci_register_driver() failed. Add fail path to
    call i40e_dbg_exit() to remove the debugfs entries to prevent the bug.
    
    i40e: Intel(R) Ethernet Connection XL710 Network Driver
    i40e: Copyright (c) 2013 - 2019 Intel Corporation.
    debugfs: Directory 'i40e' with parent '/' already present!
    
    Fixes: 41c445ff0f48 ("i40e: main driver core")
    Signed-off-by: Shang XiaoJing <shangxiaojing@xxxxxxxxxx>
    Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Tested-by: Gurucharan G <gurucharanx.g@xxxxxxxxx> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index ad6f6fe25057..19b5c5677584 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -16494,6 +16494,8 @@ static struct pci_driver i40e_driver = {
  **/
 static int __init i40e_init_module(void)
 {
+	int err;
+
 	pr_info("%s: %s\n", i40e_driver_name, i40e_driver_string);
 	pr_info("%s: %s\n", i40e_driver_name, i40e_copyright);
 
@@ -16511,7 +16513,14 @@ static int __init i40e_init_module(void)
 	}
 
 	i40e_dbg_init();
-	return pci_register_driver(&i40e_driver);
+	err = pci_register_driver(&i40e_driver);
+	if (err) {
+		destroy_workqueue(i40e_wq);
+		i40e_dbg_exit();
+		return err;
+	}
+
+	return 0;
 }
 module_init(i40e_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