Re: [PATCH v5 08/18] iio: magnetometer: ak8975: check if gpiod read was successful
From: Joshua Crofts
Date: Wed May 06 2026 - 03:35:10 EST
On Wed, 6 May 2026 at 09:16, Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
>
> On Wed, May 06, 2026 at 02:13:37AM -0500, Maxwell Doose wrote:
> > On Wed, May 6, 2026 at 2:11 AM Andy Shevchenko
> > <andriy.shevchenko@xxxxxxxxx> wrote:
> > > On Tue, May 05, 2026 at 08:42:12PM -0500, Maxwell Doose wrote:
> > > > On Tue, May 5, 2026 at 8:09 PM Maxwell Doose <m32285159@xxxxxxxxx> wrote:
> > > > > On Tue May 5, 2026 at 6:46 AM CDT, Joshua Crofts via B4 Relay wrote:
>
> ...
>
> > > > Actually, timeout. Sashiko had a good potential catch here:
> > > >
> > > > https://sashiko.dev/#/patchset/20260505-magnetometer-fixes-v5-0-831b9b5550fc%40gmail.com
> > > >
> > > > "Does this new error path leak the pm runtime reference?
> > > > In ak8975_read_axis(), a pm runtime reference is acquired via
> > > > pm_runtime_get_sync(&data->client->dev). If this new error path returns
> > > > val back up the call chain through ak8975_start_read_axis() to
> > > > ak8975_read_axis(), the code jumps to the exit label.
> > > > The exit block unlocks the mutex and returns the error code, but it skips
> > > > calling pm_runtime_put_autosuspend()."
> > >
> > > While it seems like a valid concern, it doesn't relate to this change.
> > >
> > > > I'm going to withdraw my reviewed-by until I can confirm that this
> > > > isn't a problem, sorry about that.
> > >
> > > Why?
> >
> > I just wanted to make sure this wouldn't cause some crazy regression,
> > I think it's valid to be somewhat concerned.
>
> Yes, but this was the concern even before this patch, no?
IMO yes, even the first error path would leak the pm_runtime reference.
--
Kind regards
CJD