aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2023-05-05 11:16:07 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2023-05-05 11:19:47 -0700
commit978134c4b192ed04ecf699be3e1b4d23b5d20457 (patch)
tree7044cc3c9e0150f2c189058261f8d9979195352f /drivers/input/input.c
parent529de2f1ca3f0898c0d905b7d355a43dce1de7dc (diff)
downloadlinux-978134c4b192ed04ecf699be3e1b4d23b5d20457.tar.gz
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: a181616487db ("Input: Add "inhibited" property") Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Link: https://lore.kernel.org/r/ZFFz0xAdPNSL3PT7@google.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 37e876d45eb9c2..641eb86f276e6d 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -703,7 +703,7 @@ void input_close_device(struct input_handle *handle)
__input_release_device(handle);
- if (!dev->inhibited && !--dev->users) {
+ if (!--dev->users && !dev->inhibited) {
if (dev->poller)
input_dev_poller_stop(dev->poller);
if (dev->close)