Skip to content

Commit

Permalink
USB: serial: opticon: fix CTS retrieval at open
Browse files Browse the repository at this point in the history
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: 7a6ee2b ("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>
  • Loading branch information
Johan Hovold committed Jan 16, 2017
1 parent 39712e8 commit 2eee050
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/serial/opticon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2eee050

Please sign in to comment.