Re: [PATCH v2 2/4] iio: gyro: mpu3050: Fix irq resource leak

From: Andy Shevchenko

Date: Tue Feb 24 2026 - 05:04:09 EST


On Mon, Feb 23, 2026 at 08:35:09PM -0600, Ethan Tidmore wrote:
> The interrupt handler is setup but only a few lines down if
> iio_trigger_register() fails the function returns without properly
> releasing the handler:

> ret = request_threaded_irq(irq,
> mpu3050_irq_handler,
> mpu3050_irq_thread,
> irq_trig,
> mpu3050->trig->name,
> mpu3050->trig);
>
> ...
>
> ret = iio_trigger_register(mpu3050->trig);
> if (ret)
> return ret;
>
> indio_dev->trig = iio_trigger_get(mpu3050->trig);
>
> return 0;
> }

Same comment, try to avoid citing the existing information (id est
the contents of the file).

> Add cleanup goto to resolve resource leak.
>
> Detected by Smatch:
> drivers/iio/gyro/mpu3050-core.c:1128 mpu3050_trigger_probe() warn:
> 'irq' from request_threaded_irq() not released on lines: 1124.

--
With Best Regards,
Andy Shevchenko