rtl8xxxu: prevent leaking urb
Subsystems (3)
PATCH 1/1 rtl8xxxu: prevent leaking urb
In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb should be released.
Signed-off-by Navid Emamdoost <[email protected]>
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 + 1 file changed, 1 insertion(+)
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; }
Signature · 1 line
2.17.1
Quoted 5 lines · Navid Emamdoost
In
rtl8xxxu_submit_int_urbifusb_submit_urbfails the allocated urb should be released.Signed-off-by Navid Emamdoost <[email protected]>
Reviewed-by Chris Chiu <[email protected]>
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
Quoted 5 lines · Navid Emamdoost
In
rtl8xxxu_submit_int_urbifusb_submit_urbfails the allocated urb should be released.Signed-off-by Navid Emamdoost <[email protected]>Reviewed-by Chris Chiu <[email protected]>
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