Commit 03128643 authored by Reto Schneider's avatar Reto Schneider Committed by Kalle Valo
Browse files

rtlwifi: rtl8192cu: Prevent leaking urb



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.ch
parent ec89032c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;