USB: fix error handling for mct_u232
authorOliver Neukum <oneukum@suse.de>
Thu, 29 Mar 2007 08:45:17 +0000 (10:45 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 27 Apr 2007 20:28:38 +0000 (13:28 -0700)
we report errors to the caller. THis patch adds error handling to the driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/mct_u232.c

index 4cd839b1407f3febab668bd6d27850e60fbae1f5..3db1adc25f842d30934b9b07c6cfd626f55a12fa 100644 (file)
@@ -438,17 +438,21 @@ static int  mct_u232_open (struct usb_serial_port *port, struct file *filp)
        if (retval) {
                err("usb_submit_urb(read bulk) failed pipe 0x%x err %d",
                    port->read_urb->pipe, retval);
-               goto exit;
+               goto error;
        }
 
        port->interrupt_in_urb->dev = port->serial->dev;
        retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
-       if (retval)
+       if (retval) {
+               usb_kill_urb(port->read_urb);
                err(" usb_submit_urb(read int) failed pipe 0x%x err %d",
                    port->interrupt_in_urb->pipe, retval);
-
-exit:
+               goto error;
+       }
        return 0;
+
+error:
+       return retval;
 } /* mct_u232_open */