From: Johan Hovold Date: Sat, 15 May 2010 15:53:43 +0000 (+0200) Subject: USB: kobil: fix memory leak X-Git-Tag: v2.6.35-rc1~471^2~34 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=c0f631d1948658b27349545b2cbcb4b32f010c7a 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 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index c113a2a..bd5bd85 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/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; }