From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: dudl@cypress.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate()
Date: Thu, 17 Sep 2026 08:15:01 -0700 [thread overview]
Message-ID: <aqwD1o6J4svIevWW@google.com> (raw)
In-Reply-To: <20260916185015.2093520-1-vulab@iscas.ac.cn>
Hi Wentao,
On Wed, Sep 16, 2026 at 06:50:15PM +0000, Wentao Liang wrote:
> pm_runtime_get_sync() unconditionally increments the runtime PM usage
> counter. If mutex_lock_interruptible() is interrupted, the function
> returns without dropping that reference. Add the missing
> pm_runtime_put_sync_autosuspend() call on the error path.
>
> Fixes: 672865080a8f ("Input: cyapa - add runtime power management support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/input/mouse/cyapa.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
> index 6e0d956617a1..5edf4fdbb373 100644
> --- a/drivers/input/mouse/cyapa.c
> +++ b/drivers/input/mouse/cyapa.c
> @@ -901,8 +901,10 @@ static ssize_t cyapa_update_rt_suspend_scanrate(struct device *dev,
> pm_runtime_get_sync(dev);
>
> error = mutex_lock_interruptible(&cyapa->state_sync_lock);
> - if (error)
> + if (error) {
> + pm_runtime_put_sync_autosuspend(dev);
Why does it have to be "sync" variant?
Thanks.
--
Dmitry
prev parent reply other threads:[~2026-09-17 15:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 18:50 Wentao Liang
2026-09-17 15:15 ` Dmitry Torokhov [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=aqwD1o6J4svIevWW@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=dudl@cypress.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®