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

Andy Shevchenko andriy.shevchenko at intel.com
Tue Nov 17 08:45:29 PST 2026


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





More information about the linux-arm-kernel mailing list