wifi: rtlwifi: fix init_sw_vars leak when probe fails
[ Upstream commit 00260350aed80c002df270c805ca443ec9a719a6 ]
If ieee80211_register_hw fails, the memory allocated for the firmware will
not be released. Call deinit_sw_vars as the function that undoes the
allocationes done by init_sw_vars.
Fixes: cefe3dfdb9
("rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe")
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/20241107133322.855112-5-cascardo@igalia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
322052d690
commit
82beaa3b37
@ -1082,6 +1082,7 @@ int rtl_usb_probe(struct usb_interface *intf,
|
||||
|
||||
error_init_vars:
|
||||
wait_for_completion(&rtlpriv->firmware_loading_complete);
|
||||
rtlpriv->cfg->ops->deinit_sw_vars(hw);
|
||||
error_out:
|
||||
rtl_deinit_core(hw);
|
||||
error_out2:
|
||||
|
Loading…
Reference in New Issue
Block a user