]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
USB: serial: opticon: fix CTS retrieval at open
authorJohan Hovold <johan@kernel.org>
Fri, 13 Jan 2017 12:21:08 +0000 (13:21 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 1 Mar 2017 14:13:35 +0000 (07:13 -0700)
BugLink: http://bugs.launchpad.net/bugs/1668993
commit 2eee05020a0e7ee7c04422cbacdb07859e45dce6 upstream.

The opticon driver used a control request at open to trigger a CTS
status notification to be sent over the bulk-in pipe. When the driver
was converted to using the generic read implementation, an inverted test
prevented this request from being sent, something which could lead to
TIOCMGET reporting an incorrect CTS state.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 7a6ee2b02751 ("USB: opticon: switch to generic read implementation")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/usb/serial/opticon.c

index 5ded6f524d59128e66e1864255515b5720d64921..b3c64f557d6057706932464c11af4154245ff12a 100644 (file)
@@ -142,7 +142,7 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port)
        usb_clear_halt(port->serial->dev, port->read_urb->pipe);
 
        res = usb_serial_generic_open(tty, port);
-       if (!res)
+       if (res)
                return res;
 
        /* Request CTS line state, sometimes during opening the current