Re: [PATCH] iio: chemical: ens160: Fix trigger reference leak in ens160_setup_trigger()
From: Jonathan Cameron
Date: Wed Sep 16 2026 - 20:30:10 EST
On Wed, 16 Sep 2026 16:26:38 +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_irq() in ens160_setup_trigger(), or of chip init or
> triggered buffer setup in devm_ens160_core_probe(), returns before
> that mode is set and leaks the reference acquired for indio_dev->trig.
> Request the IRQ before taking the reference and set up the trigger
> after the triggered buffer so that only failures with the mode
> already set follow the iio_trigger_get().
>
> Fixes: 0fc26596b4b3 ("iio: chemical: ens160: add triggered buffer support")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
Same again. Not this solution.