From: Johan Hovold Date: Sun, 6 Nov 2011 18:06:35 +0000 (+0100) Subject: USB: pl2302: clean up error handling in open X-Git-Tag: MMI-PSA29.97-13-9~17726^2~72 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d4691c3fa3d371835b1eacb39066ab113c4b9d8c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git USB: pl2302: clean up error handling in open Reorder urb submission and simply kill interrupt urb should read-urb submission fail (rather than calling close). Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 506d1e930c3e..9fdc944ff48d 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -503,21 +503,20 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port) if (tty) pl2303_set_termios(tty, port, &tmp_termios); - dbg("%s - submitting read urb", __func__); - result = usb_serial_generic_submit_read_urb(port, GFP_KERNEL); - if (result) { - pl2303_close(port); - return result; - } - dbg("%s - submitting interrupt urb", __func__); result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); if (result) { dev_err(&port->dev, "%s - failed submitting interrupt urb," " error %d\n", __func__, result); - pl2303_close(port); return result; } + + result = usb_serial_generic_submit_read_urb(port, GFP_KERNEL); + if (result) { + usb_kill_urb(port->interrupt_in_urb); + return result; + } + port->port.drain_delay = 256; return 0; }