diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-01-06 15:48:42 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-20 15:24:33 -0800 |
commit | 2591530204a76fecc843529ade56afe865dd2657 (patch) | |
tree | a7cf437c4bb34308e871fc62ae5a9b24f2a9854f | |
parent | 25719e6b4631959c9ecb1db6967537a124c4a7fa (diff) | |
download | linux-3.10-2591530204a76fecc843529ade56afe865dd2657.tar.gz linux-3.10-2591530204a76fecc843529ade56afe865dd2657.tar.bz2 linux-3.10-2591530204a76fecc843529ade56afe865dd2657.zip |
usb: serial: fix memory leak in generic driver
Fix a regression introduced by commit
715b1dc01fe44537e8fce9566e4bb48d6821d84b ("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>
-rw-r--r-- | drivers/usb/serial/generic.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 5ce033ab9b9..83443d6306d 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -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; |