Re: [PATCH v2 4/4] iio: magnetometer: rm3100: Use guard(mutex)() in rm3100_trigger_handler()

Maxwell Doose
2026-04-28T17:20:54Z

On Tue, Apr 28, 2026 at 10:32 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> Read the guidance in cleanup.h It's pretty clear that nothing from
> that file should ever be used in functions that use gotos.
>
> Whilst there might not be a bug here, it ends up being fragile
> as people changing the code may not noticed that can't use an existing
> label and hence jump the hidden __free() in that guard() call.
>

Then I guess if we really want to do this then we should probably get
rid of the gotos? Because I can certainly do that. Either that or we
just keep the manual locks and unlocks.

> Be careful to ensure any expanded scope only contains calls where you can
> easily see they don't deadlock or do anything time consuming.

I'll also double-check that.

best regards,
maxwell