diff mbox series

[3/3] rtl8192cu: Free ieee80211_hw if probing fails

Message ID 20200622132113.14508-4-code@reto-schneider.ch (mailing list archive)
State Accepted
Commit a7f7c15e945a24fbb8ff99d3b19ab0dcd764030d
Delegated to: Kalle Valo
Headers show
Series rtl8192cu: Fixes for leaks and deadlock | expand

Commit Message

Reto Schneider June 22, 2020, 1:21 p.m. UTC
In case of an error, no one will use the allocated structure. Call
ieee80211_free_hw, same as in rtl_usb_disconnect.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
---
 drivers/net/wireless/realtek/rtlwifi/usb.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index 1a9fcb2697bf..d05e709536ea 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -1087,6 +1087,7 @@  int rtl_usb_probe(struct usb_interface *intf,
 	usb_put_dev(udev);
 	complete(&rtlpriv->firmware_loading_complete);
 	kfree(rtlpriv->usb_data);
+	ieee80211_free_hw(hw);
 	return -ENODEV;
 }
 EXPORT_SYMBOL(rtl_usb_probe);