Skip to content

Commit 82e0609

Browse files
committed
Input: cm109 - do not stomp on control URB
We need to make sure we are not stomping on the control URB that was issued when opening the device when attempting to toggle buzzer. To do that we need to mark it as pending in cm109_open(). Reported-and-tested-by: [email protected] Cc: [email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent ce6520b commit 82e0609

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/input/misc/cm109.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,15 @@ static int cm109_input_open(struct input_dev *idev)
568568
dev->ctl_data->byte[HID_OR2] = dev->keybit;
569569
dev->ctl_data->byte[HID_OR3] = 0x00;
570570

571+
dev->ctl_urb_pending = 1;
571572
error = usb_submit_urb(dev->urb_ctl, GFP_KERNEL);
572-
if (error)
573+
if (error) {
574+
dev->ctl_urb_pending = 0;
573575
dev_err(&dev->intf->dev, "%s: usb_submit_urb (urb_ctl) failed %d\n",
574576
__func__, error);
575-
else
577+
} else {
576578
dev->open = 1;
579+
}
577580

578581
mutex_unlock(&dev->pm_mutex);
579582

0 commit comments

Comments
 (0)