Skip to contentSkip to conversation

USB: serial: opticon: fix CTS retrieval at open

PATCH In review Johan Hovold 2 participants 3 messages Jan 13, 2017 – Jan 16, 2017

Subsystems (3)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes 7a6ee2b02751 ("USB: opticon: switch to generic read

implementation")

---
 drivers/usb/serial/opticon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/serial/opticon.c +1 -1
index 5ded6f524d59..b3c64f557d60 100644
@@ -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
Signature · 1 line
2.10.2
Reviewed-by Greg Kroah-Hartman on v1 1/1
#1 lore raw
Quoted 6 lines · Johan Hovold

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.

Quoted 9 lines
Fixes 7a6ee2b02751 ("USB: opticon: switch to generic read

implementation")

---
 drivers/usb/serial/opticon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
author maintainer
#2 lore raw
Quoted 17 lines · Greg Kroah-Hartman
Quoted 6 lines · Johan Hovold

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.

Quoted 9 lines
Fixes 7a6ee2b02751 ("USB: opticon: switch to generic read

implementation")

---
 drivers/usb/serial/opticon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 1 line

Thanks for the review. Now applied for -next.

Johan