[PATCH v5 1/8] iio: adc: at91_adc: skip unpopulated triggers on teardown
Joshua Crofts
crofts at kernel.org
Sun Nov 22 23:53:23 PST 2026
On 23-Nov-26 8:00, Abdelnasser Hussein wrote:
> The driver keeps an array of triggers and leaves the slots for external
> triggers unpopulated (NULL) when the "atmel,adc-use-external-triggers"
> property is not set. Both the error rollback path in
> at91_adc_trigger_init() and at91_adc_trigger_remove() walk the whole
> array and call iio_trigger_unregister() and iio_trigger_free() on every
> entry, including the empty ones, which dereferences NULL.
>
> Skip unpopulated trigger slots in both loops.
>
> Make a minimal fix to simplify backporting. Moving over to device managed
> cleanup will shortly remove this code.
>
> Fixes: 0e589d5fb317 ("ARM: AT91: IIO: Add AT91 ADC driver.")
> Cc: stable at vger.kernel.org
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11 at gmail.com>
> ---
Reviewed-by: Joshua Crofts <crofts at kernel.org>
--
Kind regards,
Joshua Crofts
More information about the linux-arm-kernel
mailing list