Re: [PATCH] iio: chemical: scd30: Fix trigger reference leak in scd30_setup_trigger()

From: Jonathan Cameron

Date: Wed Sep 16 2026 - 20:33:47 EST


On Wed, 16 Sep 2026 16:28:17 +0000
Wentao Liang <vulab@xxxxxxxxxxx> wrote:

> The reference taken with iio_trigger_get() is only dropped by
> iio_dev_release() when INDIO_BUFFER_TRIGGERED is set. Failure of
> devm_request_threaded_irq() in scd30_setup_trigger(), or of triggered
> buffer setup in scd30_probe(), returns before that mode is set and
> leaks the reference acquired for indio_dev->trig. Take the reference
> after the IRQ request succeeds and set up the trigger after the
> buffer so that only failures with the mode already set follow the
> iio_trigger_get().
>
> Fixes: 64b3d8b1b0f5 ("iio: chemical: scd30: add core driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
Same again. See bma220. Not this solution.

Jonathan