aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/opticon.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-01-13 13:21:08 +0100
committerJohan Hovold <johan@kernel.org>2017-01-16 16:42:21 +0100
commit2eee05020a0e7ee7c04422cbacdb07859e45dce6 (patch)
tree1c999c9d819117e07b736cb88c834feea0f1a03d /drivers/usb/serial/opticon.c
parentUSB: serial: ti_usb_3410_5052: fix control-message error handling (diff)
downloadlinux-dev-2eee05020a0e7ee7c04422cbacdb07859e45dce6.tar.xz
linux-dev-2eee05020a0e7ee7c04422cbacdb07859e45dce6.zip
USB: serial: opticon: fix CTS retrieval at open
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") Cc: stable <stable@vger.kernel.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/opticon.c')
-rw-r--r--drivers/usb/serial/opticon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index 5ded6f524d59..b3c64f557d60 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -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