mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
rtlwifi: rtl8192cu: Prevent leaking urb
[ Upstream commit 03128643eb ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e840d01d94
commit
31d0d72123
@@ -752,8 +752,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;
|
||||
|
||||
Reference in New Issue
Block a user