Patch "bnxt_en: Remove debugfs when pci_register_driver failed" has been added to the 4.19-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

    bnxt_en: Remove debugfs when pci_register_driver failed

to the 4.19-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:
     bnxt_en-remove-debugfs-when-pci_register_driver-fail.patch
and it can be found in the queue-4.19 subdirectory.

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



commit f5f471f27313f2af4fa0e638e1c4810977c9d653
Author: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
Date:   Fri Nov 11 15:04:33 2022 +0800

    bnxt_en: Remove debugfs when pci_register_driver failed
    
    [ Upstream commit 991aef4ee4f6eb999924f429b943441a32835c8f ]
    
    When pci_register_driver failed, we need to remove debugfs,
    which will caused a resource leak, fix it.
    
    Resource leak logs as follows:
    [   52.184456] debugfs: Directory 'bnxt_en' with parent '/' already present!
    
    Fixes: cabfb09d87bd ("bnxt_en: add debugfs support for DIM")
    Signed-off-by: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
    Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Reviewed-by: Michael Chan <michael.chan@xxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index b49f8a97d753..dc106212259a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9383,8 +9383,16 @@ static struct pci_driver bnxt_pci_driver = {
 
 static int __init bnxt_init(void)
 {
+	int err;
+
 	bnxt_debug_init();
-	return pci_register_driver(&bnxt_pci_driver);
+	err = pci_register_driver(&bnxt_pci_driver);
+	if (err) {
+		bnxt_debug_exit();
+		return err;
+	}
+
+	return 0;
 }
 
 static void __exit bnxt_exit(void)



[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