Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f93b3e8212df43ff380e118aebb68f6d1e5b060
Commit:     4f93b3e8212df43ff380e118aebb68f6d1e5b060
Parent:     0cef7727c953056bb3ef9852a79d9658a1d8df4e
Author:     Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 20 13:15:05 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:28:37 2007 -0700

    USB: omninet memory leak in error case
    
    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 |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 0216ac1..357cc11 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)
                      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;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to