stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB: serial: opticon: fix CTS retrieval at open
@ 2017-01-13 12:21 Johan Hovold
  2017-01-13 12:41 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Hovold @ 2017-01-13 12:21 UTC (permalink / raw)
  To: linux-usb; +Cc: Dan Carpenter, Johan Hovold, stable

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>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/opticon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-16 15:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-13 12:21 [PATCH] USB: serial: opticon: fix CTS retrieval at open Johan Hovold
2017-01-13 12:41 ` Greg KH
2017-01-16 15:44   ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).