]> Git Repo - linux.git/commitdiff
Input: cm109 - do not stomp on control URB
authorDmitry Torokhov <[email protected]>
Thu, 10 Dec 2020 04:13:24 +0000 (20:13 -0800)
committerDmitry Torokhov <[email protected]>
Fri, 11 Dec 2020 21:17:36 +0000 (13:17 -0800)
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]>
drivers/input/misc/cm109.c

index e413801f04910b581f8238d149486d1f8be451d6..f515fae465c35a9385defc26fcfda9e2e198efe6 100644 (file)
@@ -568,12 +568,15 @@ static int cm109_input_open(struct input_dev *idev)
        dev->ctl_data->byte[HID_OR2] = dev->keybit;
        dev->ctl_data->byte[HID_OR3] = 0x00;
 
+       dev->ctl_urb_pending = 1;
        error = usb_submit_urb(dev->urb_ctl, GFP_KERNEL);
-       if (error)
+       if (error) {
+               dev->ctl_urb_pending = 0;
                dev_err(&dev->intf->dev, "%s: usb_submit_urb (urb_ctl) failed %d\n",
                        __func__, error);
-       else
+       } else {
                dev->open = 1;
+       }
 
        mutex_unlock(&dev->pm_mutex);
 
This page took 0.060058 seconds and 4 git commands to generate.