mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-07-08 17:56:11 +00:00
usb: serial: fix memory leak in generic driver
commit 2591530204a76fecc843529ade56afe865dd2657 upstream.
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 <jhovold@gmail.com>
Cc: Greg KH <greg@kroah.com>
Acked-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
70f176dfdc
commit
14a2fe817f
@@ -480,6 +480,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;
|
||||
|
||||
Reference in New Issue
Block a user