Re: [PATCH] iio: gyro: mpu3050: use devm_iio_trigger_register
From: Maxwell Doose
Date: Tue May 19 2026 - 23:22:45 EST
On Tue, May 19, 2026 at 9:43 PM lixinyu <xinyuili@xxxxxxx> wrote:
>
> mpu3050_trigger_probe() allocates the DRDY trigger with
> devm_iio_trigger_alloc() but registers it with plain
> iio_trigger_register(). The remove callback calls free_irq()
> on the trigger but never calls iio_trigger_unregister(), so on
> module unload the trigger remains in the global trigger list
> while its memory is freed by devm, leaving a dangling entry.
>
> Switch to devm_iio_trigger_register() so the registration is
> undone automatically in the same devm scope as the allocation.
>
> Fixes: 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: lixinyu <xinyuili@xxxxxxx>
Hm...this signed-off-by doesn't look right (unless, of course,
"lixinyu" is your real name and not "Li Xinyu" or something like
that). Please correct if you send v2.
best regards,
max