mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
usb: serial: fix memory leak in generic driver
Fix a regression introduced by commit
715b1dc01f ("USB: usb_debug,
usb_generic_serial: implement multi urb write").
URB transfer buffer was never freed when using multi-urb writes.
Currently the only driver enabling multi-urb writes is usb_debug.
Signed-off-by: Johan Hovold <[email protected]>
Cc: Greg KH <[email protected]>
Acked-by: Jason Wessel <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
25719e6b46
commit
2591530204
1 changed files with 2 additions and 0 deletions
|
|
@ -489,6 +489,8 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb)
|
|||
dbg("%s - port %d", __func__, port->number);
|
||||
|
||||
if (port->serial->type->max_in_flight_urbs) {
|
||||
kfree(urb->transfer_buffer);
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
--port->urbs_in_flight;
|
||||
port->tx_bytes_flight -= urb->transfer_buffer_length;
|
||||
|
|
|
|||
Loading…
Reference in a new issue