Skip to contentSkip to conversation

rtl8xxxu: prevent leaking urb

PATCH In review Navid Emamdoost 3 participants 3 messages Sep 20, 2019 – Oct 2, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtl8xxxu: prevent leaking urb

In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb should be released.

---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -0
index 8136e268b4e6..4a559c37e208 100644
@@ -5443,6 +5443,7 @@ static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw)
 	ret = usb_submit_urb(urb, GFP_KERNEL);
 	if (ret) {
 		usb_unanchor_urb(urb);
+		usb_free_urb(urb);
 		goto error;
 	}
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Navid Emamdoost

In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb should be released.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw) · line 5448

Quoted 9 lines
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -0
@@ -5443,6 +5443,7 @@ static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw)
        ret = usb_submit_urb(urb, GFP_KERNEL);
        if (ret) {
                usb_unanchor_urb(urb);
+               usb_free_urb(urb);
                goto error;
        }

You're right. There's a usb_alloc_urb in the beginning of this function and should be
handled after submit failure.

Chris

#2 lore raw
In reply to Navid Emamdoost
Quoted 5 lines · Navid Emamdoost

In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb should be released.

Patch applied to wireless-drivers-next.git, thanks.

a2cdd07488e6 rtl8xxxu: prevent leaking urb

Signature · 3 lines
https://patchwork.kernel.org/patch/11153733/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches