]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: rtlwifi: destroy workqueue at rtl_deinit_core
authorThadeu Lima de Souza Cascardo <cascardo@igalia.com>
Fri, 6 Dec 2024 17:37:11 +0000 (14:37 -0300)
committerPing-Ke Shih <pkshih@realtek.com>
Thu, 12 Dec 2024 02:32:05 +0000 (10:32 +0800)
commitd8ece6fc3694657e4886191b32ca1690af11adda
tree4c3c1ac488c8c2d6df64df24be2ea02eb1927479
parent2fdac64c3c35858aa8ac5caa70b232e03456e120
wifi: rtlwifi: destroy workqueue at rtl_deinit_core

rtl_wq is allocated at rtl_init_core, so it makes more sense to destroy it
at rtl_deinit_core. In the case of USB, where _rtl_usb_init does not
require anything to be undone, that is fine. But for PCI, rtl_pci_init,
which is called after rtl_init_core, needs to deallocate data, but only if
it has been called.

That means that destroying the workqueue needs to be done whether
rtl_pci_init has been called or not. And since rtl_pci_deinit was doing it,
it has to be moved out of there.

It makes more sense to move it to rtl_deinit_core and have it done in both
cases, USB and PCI.

Since this is a requirement for a followup memory leak fix, mark this as
fixing such memory leak.

Fixes: 0c8173385e54 ("rtl8192ce: Add new driver")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20241206173713.3222187-3-cascardo@igalia.com
drivers/net/wireless/realtek/rtlwifi/base.c
drivers/net/wireless/realtek/rtlwifi/pci.c
drivers/net/wireless/realtek/rtlwifi/usb.c