From: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
To: Jonathan Cameron <jic23@kernel.org>,
Moksh Panicker <mokshpanicker.7@gmail.com>
Cc: dlechner@baylibre.com, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
skhan@linuxfoundation.org
Subject: Re: [PATCH] iio: light: apds9306: fix PM reference leak in apds9306_read_data()
Date: Sat, 1 Aug 2026 18:23:19 +0930 [thread overview]
Message-ID: <166588b4-7bd6-400e-9be3-300dd1a1f9f6@tweaklogic.com> (raw)
In-Reply-To: <20260727033151.0ea0cb9d@jic23-huawei>
On 27/7/26 12:01 pm, Jonathan Cameron wrote:
> On Sat, 25 Jul 2026 05:10:48 +0000
> Moksh Panicker <mokshpanicker.7@gmail.com> wrote:
>
>> apds9306_read_data() calls pm_runtime_resume_and_get() but several
>> error paths return directly without calling pm_runtime_put_autosuspend(),
>> leaking the runtime PM reference and preventing the device from
>> autosuspending.
>>
>> Add a goto label before pm_runtime_put_autosuspend() and use it on
>> all error paths after a successful pm_runtime_resume_and_get().
>>
>> Fixes: 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
> Good find.
> Please look at PM_RUNTIME_ACQUIRE_AUTOSUSPEND() and matching ERR macro.
>
> Using that should simplify this fix quite a bit and generally give us nicer code.
Nice. Ditto. I have to read about it too. Thanks Jonathan.
prev parent reply other threads:[~2026-08-01 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 5:10 Moksh Panicker
2026-07-27 2:31 ` Jonathan Cameron
2026-08-01 8:53 ` Subhajit Ghosh [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=166588b4-7bd6-400e-9be3-300dd1a1f9f6@tweaklogic.com \
--to=subhajit.ghosh@tweaklogic.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mokshpanicker.7@gmail.com \
--cc=skhan@linuxfoundation.org \
--cc=stable@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 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®