Skip to content

Commit 1a6e9a9

Browse files
jhovolddavem330
authored andcommitted
net: hso: 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 tiocmset and rfkill requests which erroneously used usb_rcvctrlpipe(). Fixes: 72dc1c0 ("HSO: add option hso driver") Cc: [email protected] # 2.6.27 Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1a44fb3 commit 1a6e9a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/usb/hso.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ static int hso_serial_tiocmset(struct tty_struct *tty,
16891689
spin_unlock_irqrestore(&serial->serial_lock, flags);
16901690

16911691
return usb_control_msg(serial->parent->usb,
1692-
usb_rcvctrlpipe(serial->parent->usb, 0), 0x22,
1692+
usb_sndctrlpipe(serial->parent->usb, 0), 0x22,
16931693
0x21, val, if_num, NULL, 0,
16941694
USB_CTRL_SET_TIMEOUT);
16951695
}
@@ -2436,7 +2436,7 @@ static int hso_rfkill_set_block(void *data, bool blocked)
24362436
if (hso_dev->usb_gone)
24372437
rv = 0;
24382438
else
2439-
rv = usb_control_msg(hso_dev->usb, usb_rcvctrlpipe(hso_dev->usb, 0),
2439+
rv = usb_control_msg(hso_dev->usb, usb_sndctrlpipe(hso_dev->usb, 0),
24402440
enabled ? 0x82 : 0x81, 0x40, 0, 0, NULL, 0,
24412441
USB_CTRL_SET_TIMEOUT);
24422442
mutex_unlock(&hso_dev->mutex);

0 commit comments

Comments
 (0)