Skip to content

Commit

Permalink
rtlwifi: rtl8192cu: Prevent leaking urb
Browse files Browse the repository at this point in the history
[ Upstream commit 0312864 ]

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>
  • Loading branch information
rettichschnidi authored and gregkh committed Sep 3, 2020
1 parent 3a84491 commit 71e7e02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/wireless/realtek/rtlwifi/usb.c
Expand Up @@ -718,8 +718,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;
Expand Down

0 comments on commit 71e7e02

Please sign in to comment.