[PATCH] USB: usb_wwan: Fix urb leak in usb_wwan_close()

From: Wentao Liang

Date: Wed Sep 16 2026 - 14:50:02 EST


usb_wwan_close() drains the delayed write urbs with
usb_get_from_anchor(), which returns the urb with a new reference
taken. The loop only clears the busy flag of the urb and never drops
that reference, so each drained urb keeps one reference forever and
the urb object is not freed when usb_wwan_port_remove() later drops
the port's own reference.

Drop the reference with usb_put_urb() once the urb has been found in
the out_urb array by unbusy_queued_urb(), leaving the reference held
by the port's preallocated out_urbs array.

Fixes: 79eed03e77d4 ("USB: usb_wwan: fix urb leak at shutdown")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/usb/serial/usb_wwan.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index e752ffa4dc62..2c46330f10da 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -403,6 +403,7 @@ void usb_wwan_close(struct usb_serial_port *port)
if (!urb)
break;
unbusy_queued_urb(urb, portdata);
+ usb_put_urb(urb);
usb_autopm_put_interface_async(serial->interface);
}

--
2.34.1