diff options
author | Reto Schneider <code@reto-schneider.ch> | 2020-06-22 15:21:12 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-07-15 13:37:13 +0300 |
commit | 03128643eb5453a798db5770952c73dc64fcaf00 (patch) | |
tree | 13853fa3f0446c8d51e86a3ade4e3a1d564d90b9 /drivers/net/wireless/realtek | |
parent | ec89032cd148f8805c5adf5d38f1f382036f5a5c (diff) |
rtlwifi: rtl8192cu: Prevent leaking urb
If usb_submit_urb fails the allocated urb should be unanchored and
released.
Signed-off-by: Reto Schneider <code@reto-schneider.ch>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200622132113.14508-3-code@reto-schneider.ch
Diffstat (limited to 'drivers/net/wireless/realtek')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/usb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c index d3bbfc0171f6..1a9fcb2697bf 100644 --- a/drivers/net/wireless/realtek/rtlwifi/usb.c +++ b/drivers/net/wireless/realtek/rtlwifi/usb.c @@ -720,8 +720,11 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw) usb_anchor_urb(urb, &rtlusb->rx_submitted); err = usb_submit_urb(urb, GFP_KERNEL); - if (err) + if (err) { + usb_unanchor_urb(urb); + usb_free_urb(urb); goto err_out; + } usb_free_urb(urb); } return 0; |