Skip to content

Commit

Permalink
usb: serial: fix memory leak in generic driver
Browse files Browse the repository at this point in the history
Fix a regression introduced by commit
715b1dc ("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>
Cc: stable <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
jhovold authored and gregkh committed Jan 20, 2010
1 parent 25719e6 commit 2591530
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/serial/generic.c
Expand Up @@ -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;
Expand Down

0 comments on commit 2591530

Please sign in to comment.