2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 10:44:14 +08:00

USB: omninet memory leak in error case

memory allocated must be freed in the error case.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Oliver Neukum 2007-03-20 13:15:05 +01:00 committed by Greg Kroah-Hartman
parent 0cef7727c9
commit 4f93b3e821

View File

@ -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;
}