Commit 644e4f24 authored by Reto Schneider's avatar Reto Schneider Committed by Greg Kroah-Hartman

rtlwifi: rtl8192cu: Prevent leaking urb

[ Upstream commit 03128643 ]

If usb_submit_urb fails the allocated urb should be unanchored and
released.
Signed-off-by: default avatarReto Schneider <code@reto-schneider.ch>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200622132113.14508-3-code@reto-schneider.chSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4841465f
...@@ -739,8 +739,11 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw) ...@@ -739,8 +739,11 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
usb_anchor_urb(urb, &rtlusb->rx_submitted); usb_anchor_urb(urb, &rtlusb->rx_submitted);
err = usb_submit_urb(urb, GFP_KERNEL); err = usb_submit_urb(urb, GFP_KERNEL);
if (err) if (err) {
usb_unanchor_urb(urb);
usb_free_urb(urb);
goto err_out; goto err_out;
}
usb_free_urb(urb); usb_free_urb(urb);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment