From: Peter Hutterer <peter.hutterer@who-t.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: fix open count when closing inhibited device
Date: Thu, 4 May 2023 14:18:19 +1000 [thread overview]
Message-ID: <20230504041819.GA1128727@quokka> (raw)
In-Reply-To: <ZFFz0xAdPNSL3PT7@google.com>
On Tue, May 02, 2023 at 01:34:27PM -0700, Dmitry Torokhov wrote:
> 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")
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Yep.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Cheers,
Peter
> ---
> drivers/input/input.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index f791d14ecf23..8c5fdb0f858a 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -705,7 +705,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)
> --
> 2.40.1.495.gc816e09b53d-goog
>
>
> --
> Dmitry
prev parent reply other threads:[~2023-05-04 4:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 20:34 [PATCH] Input: fix open count when closing inhibited device Dmitry Torokhov
2023-05-04 4:18 ` Peter Hutterer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230504041819.GA1128727@quokka \
--to=peter.hutterer@who-t.net \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.