Skip to contentSkip to conversation

USB: serial: quatech2: fix control-request directions

PATCH Superseded Johan Hovold 1 participant 1 message May 21, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/1 USB: serial: quatech2: fix control-request directions

The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation.

Fix the two QT2_FLUSH_DEVICE requests which erroneously used usb_rcvctrlpipe().

Fixes f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
---
 drivers/usb/serial/quatech2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/quatech2.c +2 -2
index 3b5f2032ecdb..a9ff3904375f 100644
@@ -416,7 +416,7 @@ static void qt2_close(struct usb_serial_port *port)
 
 	/* flush the port transmit buffer */
 	i = usb_control_msg(serial->dev,
-			    usb_rcvctrlpipe(serial->dev, 0),
+			    usb_sndctrlpipe(serial->dev, 0),
 			    QT2_FLUSH_DEVICE, 0x40, 1,
 			    port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT);
 
@@ -426,7 +426,7 @@ static void qt2_close(struct usb_serial_port *port)
 
 	/* flush the port receive buffer */
 	i = usb_control_msg(serial->dev,
-			    usb_rcvctrlpipe(serial->dev, 0),
+			    usb_sndctrlpipe(serial->dev, 0),
 			    QT2_FLUSH_DEVICE, 0x40, 0,
 			    port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT);
 
Signature · 1 line
2.26.3