Skip to content

Commit 978134c

Browse files
committed
Input: fix open count when closing inhibited device
Because the kernel increments device's open count in input_open_device() even if device is inhibited, the counter should always be decremented in input_close_device() to keep it balanced. Fixes: a181616 ("Input: Add "inhibited" property") Reviewed-by: Peter Hutterer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 529de2f commit 978134c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ void input_close_device(struct input_handle *handle)
703703

704704
__input_release_device(handle);
705705

706-
if (!dev->inhibited && !--dev->users) {
706+
if (!--dev->users && !dev->inhibited) {
707707
if (dev->poller)
708708
input_dev_poller_stop(dev->poller);
709709
if (dev->close)

0 commit comments

Comments
 (0)