[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220220231554.2510567-1-ztong0001@gmail.com>
Date: Sun, 20 Feb 2022 15:15:53 -0800
From: Tong Zhang <ztong0001@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jakub Kicinski <kuba@...nel.org>,
Lee Jones <lee.jones@...aro.org>,
Colin Ian King <colin.i.king@...glemail.com>,
Saurav Girepunje <saurav.girepunje@...il.com>,
Johan Hovold <johan@...nel.org>,
Tong Zhang <ztong0001@...il.com>,
Cláudio Maia <clrrm@...p.ipp.pt>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: rtl8192u: cleanup proc fs entries upon exit
proc fs entries need to be removed when module is removed, otherwise
when we try to insert the module again, kernel will complain
[ 493.068012] proc_dir_entry 'net/ieee80211' already registered
[ 493.271973] proc_mkdir+0x18/0x20
[ 493.272136] ieee80211_debug_init+0x28/0xde8 [r8192u_usb]
[ 493.272404] rtl8192_usb_module_init+0x10/0x161 [r8192u_usb]
[ 13.910616] proc_dir_entry 'net/rtl819xU' already registered
[ 13.918931] proc_mkdir+0x18/0x20
[ 13.919098] rtl8192_usb_module_init+0x142/0x16d [r8192u_usb]
Signed-off-by: Tong Zhang <ztong0001@...il.com>
---
drivers/staging/rtl8192u/r8192U_core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 364e1ca94f70..683afdc667bc 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -4825,6 +4825,11 @@ static int __init rtl8192_usb_module_init(void)
static void __exit rtl8192_usb_module_exit(void)
{
usb_deregister(&rtl8192_usb_driver);
+ remove_proc_entry(RTL819XU_MODULE_NAME, init_net.proc_net);
+
+#ifdef CONFIG_IEEE80211_DEBUG
+ ieee80211_debug_exit();
+#endif
RT_TRACE(COMP_DOWN, "Exiting");
}
--
2.25.1
Powered by blists - more mailing lists