提交 5ac43d1f 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: fix omninet memory leak found by coverity

the transfer of allocating the descriptor in attach and no longer in open
was incomplete resulting in a memory leak coverity spotted. This fix
is against the patch set you posted.
Signed-off-by: NOliver Neukum <oneukum@suse.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 ad9ddd66
...@@ -165,12 +165,10 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp) ...@@ -165,12 +165,10 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
{ {
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
struct usb_serial_port *wport; struct usb_serial_port *wport;
struct omninet_data *od = usb_get_serial_port_data(port);
int result = 0; int result = 0;
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL );
wport = serial->port[1]; wport = serial->port[1];
wport->tty = port->tty; wport->tty = port->tty;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册