Input: fix open count when closing inhibited device
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 5 May 2023 18:16:07 +0000 (11:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2023 09:15:23 +0000 (11:15 +0200)
commitc8a46f39dd2719c1044a2569a905f018f7a86b93
tree5ecb8da8e92bd9673b72aec284d9d50fe69f9fc2
parentf9172a0bb57d62a42122075a124c071a1c56e455
Input: fix open count when closing inhibited device

commit 978134c4b192ed04ecf699be3e1b4d23b5d20457 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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/input.c