aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2010-01-06 15:48:42 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-01-20 15:24:33 -0800
commit2591530204a76fecc843529ade56afe865dd2657 (patch)
treea7cf437c4bb34308e871fc62ae5a9b24f2a9854f /drivers/usb
parent25719e6b4631959c9ecb1db6967537a124c4a7fa (diff)
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/generic.c2
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;