diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-12-17 14:50:21 -0800 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-12-18 15:18:38 +0100 |
commit | 18a1b06e5b91d47dc86c0a66a762646ea7c5d141 (patch) | |
tree | 44e0eaa825fa0e9ba30d65dd7e8d89dbdeead076 /drivers/hid/hid-alps.c | |
parent | 4f3882177240a1f55e45a3d241d3121341bead78 (diff) | |
download | linux-18a1b06e5b91d47dc86c0a66a762646ea7c5d141.tar.bz2 |
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/hid-alps.c')
0 files changed, 0 insertions, 0 deletions