提交 4f93b3e8 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: omninet memory leak in error case

memory allocated must be freed in the error case.
Signed-off-by: NOliver Neukum <oneukum@suse.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 0cef7727
......@@ -170,8 +170,12 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
omninet_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result)
if (result) {
err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
/* open failed - all allocations must be freed */
kfree(od);
usb_set_serial_port_data(port, NULL);
}
return result;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册