Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 three requests which erroneously used usb_rcvctrlpipe().

Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
Cc: stable@vger.kernel.org # 3.5
Signed-off-by: Johan Hovold <johan@kernel.org>

+3 -3
+3 -3
drivers/usb/serial/quatech2.c
··· 416 416 417 417 /* flush the port transmit buffer */ 418 418 i = usb_control_msg(serial->dev, 419 - usb_rcvctrlpipe(serial->dev, 0), 419 + usb_sndctrlpipe(serial->dev, 0), 420 420 QT2_FLUSH_DEVICE, 0x40, 1, 421 421 port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT); 422 422 ··· 426 426 427 427 /* flush the port receive buffer */ 428 428 i = usb_control_msg(serial->dev, 429 - usb_rcvctrlpipe(serial->dev, 0), 429 + usb_sndctrlpipe(serial->dev, 0), 430 430 QT2_FLUSH_DEVICE, 0x40, 0, 431 431 port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT); 432 432 ··· 639 639 int status; 640 640 641 641 /* power on unit */ 642 - status = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 642 + status = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), 643 643 0xc2, 0x40, 0x8000, 0, NULL, 0, 644 644 QT2_USB_TIMEOUT); 645 645 if (status < 0) {