USB: cdc-acm: fix urb leak on disconnect
Subsystems (3)
PATCH 1/1 USB: cdc-acm: fix urb leak on disconnect
Make sure to drop the reference taken by usb_anchor_urb() when removing URBs from the delayed URB anchor to prevent them from leaking when the device is later disconnected.
Fixes 140cb81ac8c6 ("USB: cdc-acm: fix broken runtime suspend")
Reported-by Wentao Liang <[email protected]>
Cc [email protected] # 3.16
Signed-off-by Johan Hovold <[email protected]>
--- drivers/usb/class/cdc-acm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/class/cdc-acm.c +2 -1
@@ -783,6 +783,7 @@ static void acm_port_shutdown(struct tty_port *port) urb =usb_get_from_anchor (&acm->delayed);if (!urb)break ; +usb_put_urb (urb); wb = urb->context; wb->use = false;usb_autopm_put_interface_async (acm->control);
@@ -1705,7 +1706,7 @@ static int acm_resume(struct usb_interface *intf) urb =usb_get_from_anchor (&acm->delayed);if (!urb)break ; - +usb_put_urb (urb);acm_start_wb (acm, urb->context); }
Signature · 1 line
2.55.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines
Make sure to drop the reference taken by
usb_anchor_urb()when removing URBs from the delayed URB anchor to prevent them from leaking when the device is later disconnected.Fixes 140cb81ac8c6 ("USB: cdc-acm: fix broken runtime suspend")Reported-by Wentao Liang <[email protected]>Cc [email protected] # 3.16Signed-off-by Johan Hovold <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1