aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/omninet.c
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2007-03-20 08:15:05 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 16:28:37 -0400
commit4f93b3e8212df43ff380e118aebb68f6d1e5b060 (patch)
tree228ed1060a8d24a18557852ccba1805d36ffd73f /drivers/usb/serial/omninet.c
parent0cef7727c953056bb3ef9852a79d9658a1d8df4e (diff)
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>
Diffstat (limited to 'drivers/usb/serial/omninet.c')
-rw-r--r--drivers/usb/serial/omninet.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 0216ac12a27d..357cc11915cf 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -170,8 +170,12 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
170 port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, 170 port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
171 omninet_read_bulk_callback, port); 171 omninet_read_bulk_callback, port);
172 result = usb_submit_urb(port->read_urb, GFP_KERNEL); 172 result = usb_submit_urb(port->read_urb, GFP_KERNEL);
173 if (result) 173 if (result) {
174 err("%s - failed submitting read urb, error %d", __FUNCTION__, result); 174 err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
175 /* open failed - all allocations must be freed */
176 kfree(od);
177 usb_set_serial_port_data(port, NULL);
178 }
175 179
176 return result; 180 return result;
177} 181}