Re: [PATCH] iio: light: isl29028: fix runtime PM reference leak on error paths
From: Fabio Cesari
Date: Sun Sep 06 2026 - 18:15:48 EST
Hi Jonathan,
On Sun, 6 Sep 2026 18:43:58 +0100
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> Whilst perhaps not best practice as such, it is pretty
> common to just not bother checking the return of pm_runtime_put_autosuspend()
> at least partly because of that annoying -ENOSYS result if runtime pm isn't
> enabled. That is what happens with the ACQUIRE macros for instance.
>
> Do we have any particular reason to thing it is more likely to fail i this
> case than any other?
No reason: both functions already returned that value to userspace before the
patch, and I left that unchanged only because the patch was aimed at the leak.
It makes sense to fix it as well.
v2 will take the reference with PM_RUNTIME_ACQUIRE_IF_ENABLED_AUTOSUSPEND() in
both functions, as Joshua Crofts suggested, so the value goes away along with
the manual put.
Thanks for the review. v2 follows shortly.
Fabio