summaryrefslogtreecommitdiff
path: root/drivers/hid/intel-ish-hid
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2019-12-18 01:50:21 +0300
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-12-18 17:18:38 +0300
commit18a1b06e5b91d47dc86c0a66a762646ea7c5d141 (patch)
tree44e0eaa825fa0e9ba30d65dd7e8d89dbdeead076 /drivers/hid/intel-ish-hid
parent4f3882177240a1f55e45a3d241d3121341bead78 (diff)
downloadlinux-18a1b06e5b91d47dc86c0a66a762646ea7c5d141.tar.xz
HID: hiddev: fix mess in hiddev_open()
The open method of hiddev handler fails to bring the device out of autosuspend state as was promised in 0361a28d3f9a, as it actually has 2 blocks that try to start the transport (call hid_hw_open()) with both being guarded by the "open" counter, so the 2nd block is never executed as the first block increments the counter so it is never at 0 when we check it for the second block. Additionally hiddev_open() was leaving counter incremented on errors, causing the device to never be reopened properly if there was ever an error. Let's fix all of this by factoring out code that creates client structure and powers up the device into a separate function that is being called from usbhid_open() with the "existancelock" being held. Fixes: 0361a28d3f9a ("HID: autosuspend support for USB HID") Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid/intel-ish-hid')
0 files changed, 0 insertions, 0 deletions