]> git.baikalelectronics.ru Git - kernel.git/commit
Input: synaptics_usb - do not rely on input_dev->users
authorMarcus Folkesson <marcus.folkesson@gmail.com>
Sat, 17 Mar 2018 17:50:48 +0000 (10:50 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 17 Mar 2018 18:05:18 +0000 (11:05 -0700)
commit7ff3db62d5aa39a4a5a772df550ed2b5dbc1fb5d
tree60e1e671639f55731ad26195b6839a039d3446bd
parent76c55da7857fd5059d3ba877c6551e58aacdccff
Input: synaptics_usb - do not rely on input_dev->users

If the device is unused and suspended, a call to open will cause the
device to autoresume through the call to usb_autopm_get_interface().

input_dev->users is already incremented by the input subsystem,
therefore this expression will always be evaluated to true:

if ((input_dev->users || (synusb->flags & SYNUSB_IO_ALWAYS)) &&
    usb_submit_urb(synusb->urb, GFP_NOIO) < 0) {
retval = -EIO;
}

The same URB will then be fail when resubmitted in synusb_open().

Introduce synusb->is_open to keep track of the state instead.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/synaptics_usb.c