mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
usb: serial: fix memory leak in generic driver
commit2591530204upstream. Fix a regression introduced by commit715b1dc01f("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
04f7ec720e
commit
911b8be09d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user