From: Johan Hovold Date: Sat, 15 May 2010 15:53:43 +0000 (+0200) Subject: USB: kobil: fix memory leak X-Git-Tag: firefly_0821_release~10186^2~1555 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e851a5ce9d67f1b0cb5a16a48be47d63b06985f9;p=firefly-linux-kernel-4.4.55.git USB: kobil: fix memory leak commit c0f631d1948658b27349545b2cbcb4b32f010c7a upstream. An urb transfer buffer is allocated at every open but was never freed. This driver is a bit of a mess... 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 45ea694b3ae6..9d99e682f96d 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; }