Skip to content

Commit ba9a103

Browse files
jhovolddtor
authored andcommitted
Input: keyspan-remote - fix control-message timeouts
The driver was issuing synchronous uninterruptible control requests without using a timeout. This could lead to the driver hanging on probe due to a malfunctioning (or malicious) device until the device is physically disconnected. While sleeping in probe the driver prevents other devices connected to the same hub from being added to (or removed from) the bus. The USB upper limit of five seconds per request should be more than enough. Fixes: 99f83c9 ("[PATCH] USB: add driver for Keyspan Digital Remote") Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: stable <[email protected]> # 2.6.13 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent ce535a2 commit ba9a103

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/input/misc/keyspan_remote.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,23 +336,26 @@ static int keyspan_setup(struct usb_device* dev)
336336
int retval = 0;
337337

338338
retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
339-
0x11, 0x40, 0x5601, 0x0, NULL, 0, 0);
339+
0x11, 0x40, 0x5601, 0x0, NULL, 0,
340+
USB_CTRL_SET_TIMEOUT);
340341
if (retval) {
341342
dev_dbg(&dev->dev, "%s - failed to set bit rate due to error: %d\n",
342343
__func__, retval);
343344
return(retval);
344345
}
345346

346347
retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
347-
0x44, 0x40, 0x0, 0x0, NULL, 0, 0);
348+
0x44, 0x40, 0x0, 0x0, NULL, 0,
349+
USB_CTRL_SET_TIMEOUT);
348350
if (retval) {
349351
dev_dbg(&dev->dev, "%s - failed to set resume sensitivity due to error: %d\n",
350352
__func__, retval);
351353
return(retval);
352354
}
353355

354356
retval = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
355-
0x22, 0x40, 0x0, 0x0, NULL, 0, 0);
357+
0x22, 0x40, 0x0, 0x0, NULL, 0,
358+
USB_CTRL_SET_TIMEOUT);
356359
if (retval) {
357360
dev_dbg(&dev->dev, "%s - failed to turn receive on due to error: %d\n",
358361
__func__, retval);

0 commit comments

Comments
 (0)