mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] USB: serial: fix memory leak in generic driver
@ 2009-12-30 22:32 Johan Hovold
  0 siblings, 0 replies; only message in thread
From: Johan Hovold @ 2009-12-30 22:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Johan Hovold, stable

URB transfer buffer was never freed when using multi-urb writes.

Regression introduced by commit 715b1dc01fe44537e8fce9566e4bb48d6821d84b
(USB: usb_debug, usb_generic_serial: implement multi urb write).

Currently the only driver enabling multi-urb writes is usb_debug.

Cc: stable <stable@kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
 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 f1ea3a3..187259c 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;
-- 
1.6.6


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-30 22:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-30 22:32 [PATCH] USB: serial: fix memory leak in generic driver Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®