projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0cef772
)
USB: omninet memory leak in error case
author
Oliver Neukum
<
[email protected]
>
Tue, 20 Mar 2007 12:15:05 +0000
(13:15 +0100)
committer
Greg Kroah-Hartman
<
[email protected]
>
Fri, 27 Apr 2007 20:28:37 +0000
(13:28 -0700)
memory allocated must be freed in the error case.
Signed-off-by: Oliver Neukum <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/usb/serial/omninet.c
patch
|
blob
|
history
diff --git
a/drivers/usb/serial/omninet.c
b/drivers/usb/serial/omninet.c
index 0216ac12a27dae917c89bd743cb7ac36065e14b5..357cc11915cf8dc28e1445dc454a7eb916a79ac7 100644
(file)
--- 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)
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;
}