Browse Source

USB: kobil: fix memory leak

An urb transfer buffer is allocated at every open but was never freed.

This driver is a bit of a mess...

Cc: stable <stable@kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Johan Hovold 15 years ago
parent
commit
c0f631d194
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/usb/serial/kobil_sct.c

+ 2 - 1
drivers/usb/serial/kobil_sct.c

@@ -345,7 +345,8 @@ static void kobil_close(struct usb_serial_port *port)
 
 	/* FIXME: Add rts/dtr methods */
 	if (port->write_urb) {
-		usb_kill_urb(port->write_urb);
+		usb_poison_urb(port->write_urb);
+		kfree(port->write_urb->transfer_buffer);
 		usb_free_urb(port->write_urb);
 		port->write_urb = NULL;
 	}