Input: fix open count when closing inhibited device

commit 978134c4b1 upstream.

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: a181616487 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dmitry Torokhov 2023-05-05 11:16:07 -07:00 коммит произвёл Greg Kroah-Hartman
Родитель 2545d1b4d1
Коммит cd67fdd3cc
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -691,7 +691,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)