Re: [PATCH v9 2/6] iio: adc: ad4691: add initial driver for AD4691 family
From: Andy Shevchenko
Date: Fri May 08 2026 - 00:45:06 EST
On Thu, May 07, 2026 at 03:15:49PM +0100, Jonathan Cameron wrote:
> On Thu, 7 May 2026 09:26:00 +0000
> "Sabau, Radu bogdan" <Radu.Sabau@xxxxxxxxxx> wrote:
...
> > > + st->info = spi_get_device_match_data(spi);
> >
> > "Is it possible for st->info to be NULL here?
> > If the driver is manually bound to a device with a non-matching name using
> > the sysfs bind interface in combination with driver_override,
> > spi_get_device_match_data() could return NULL, which would cause a NULL
> > pointer dereference later in the probe sequence."
> >
> > Agreed, will add the NULL check with -ENODEV immediately after
> > spi_get_device_match_data().
>
> Andy, you seeing this one? Looks like we are putting these checks back in again.
> Whilst anyone forcing a bind like this is onto a looser anyway we shouldn't
> crash due to a null dereference.
We should find a way how to disable that combination from the start. The driver
makes no sense to be instantiated from user space. Actually most of the drivers
nowadays should not be bound to the devices without driver data.
--
With Best Regards,
Andy Shevchenko