Re: [PATCH v4 1/3] iio: adc: at91_adc: fix NULL pointer dereference on trigger remove

From: Andy Shevchenko

Date: Tue Nov 17 2026 - 11:45:40 EST


On Tue, Nov 17, 2026 at 06:44:37PM +0200, Andy Shevchenko wrote:
> On Tue, Nov 17, 2026 at 04:05:08PM +0200, Abdelnasser Hussein wrote:

...

> > for (i = 0; i < st->caps->trigger_number; i++) {
> > + if (!st->trig[i])
> > + continue;
> > iio_trigger_unregister(st->trig[i]);
> > iio_trigger_free(st->trig[i]);
> > }
>
> Yes, but no. Please, rather fix the above mentioned IIO trigger APIs to be
> NULL-aware.

Actually the iio_trigger_free() is already NULL-aware, so make it only for
iio_trigger_unregister().


--
With Best Regards,
Andy Shevchenko