Skip to contentSkip to conversation

USB: serial: sierra: fix urb leak on write completion

PATCH In review Johan Hovold 3 participants 3 messages Oct 9 – Oct 11

Subsystems (3)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/1 USB: serial: sierra: fix urb leak on write completion

Make sure to drop the reference taken by usb_anchor_urb() also on successful submission of delayed write URBs during runtime resume to prevent them from leaking on completion.

Fixes e6929a9020ac ("USB: support for autosuspend in sierra while online")
Cc [email protected] # 2.6.32
Cc Oliver Neukum <[email protected]>
---
 drivers/usb/serial/sierra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/sierra.c +2 -1
index 6e443aacae07..f2cc7f364d20 100644
@@ -972,12 +972,13 @@ static int sierra_submit_delayed_urbs(struct usb_serial_port *port)
 			intfdata->in_flight--;
 			usb_unanchor_urb(urb);
 			kfree(urb->transfer_buffer);
-			usb_free_urb(urb);
 
 			spin_lock(&portdata->lock);
 			portdata->outstanding_urbs--;
 			spin_unlock(&portdata->lock);
 		}
+
+		usb_put_urb(urb);
 	}
 
 	if (ec)
Signature · 1 line
2.55.0
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 10 lines

Make sure to drop the reference taken by usb_anchor_urb() also on successful submission of delayed write URBs during runtime resume to prevent them from leaking on completion.

Fixes e6929a9020ac ("USB: support for autosuspend in sierra while online")
Cc [email protected] # 2.6.32
Cc Oliver Neukum <[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
Reviewed-by Greg Kroah-Hartman on v1 1/1
#2 lore raw
In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

Make sure to drop the reference taken by usb_anchor_urb() also on successful submission of delayed write URBs during runtime resume to prevent them from leaking on completion.

Fixes e6929a9020ac ("USB: support for autosuspend in sierra while online")
Cc [email protected] # 2.6.32
Cc Oliver Neukum <[email protected]>