提交 c0f631d1 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

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: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 86234d49
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册