[PATCH 0/9] iio: adc: reject SPI devices without match data

From: Jiale Yao

Date: Fri Sep 25 2026 - 09:04:49 EST


SPI driver_override can bind a device to a driver without a matching
firmware entry or SPI device ID. In that case,
spi_get_device_match_data() returns NULL.

These nine ADC probe paths assume that the returned chip information is
present and later dereference it. Reject devices without match data before
the pointer is used, following the handling added to the AD5686 bus
frontends by commit 572a00852635 ("iio: dac: ad5686: missing NULL check on
match data").

The ADC128S052 and ADS7950 probes also dereference spi_get_device_id() to
obtain the IIO device name. Use the always available SPI modalias instead,
so the override path does not depend on a matching SPI ID.

Each patch fixes one driver and can be applied independently.

Jiale Yao (9):
iio: adc: ad7192: reject devices without match data
iio: adc: ad7606: reject devices without match data
iio: adc: ad7768-1: reject devices without match data
iio: adc: max11205: reject devices without match data
iio: adc: mcp3911: reject devices without match data
iio: adc: ti-adc128s052: validate SPI match data
iio: adc: ti-ads1018: reject devices without match data
iio: adc: ti-ads131m02: reject devices without match data
iio: adc: ti-ads7950: validate SPI match data

drivers/iio/adc/ad7192.c | 3 +++
drivers/iio/adc/ad7606_spi.c | 6 +++++-
drivers/iio/adc/ad7768-1.c | 3 +++
drivers/iio/adc/max11205.c | 2 ++
drivers/iio/adc/mcp3911.c | 2 ++
drivers/iio/adc/ti-adc128s052.c | 8 +++++---
drivers/iio/adc/ti-ads1018.c | 3 +++
drivers/iio/adc/ti-ads131m02.c | 2 ++
drivers/iio/adc/ti-ads7950.c | 4 +++-
9 files changed, 28 insertions(+), 5 deletions(-)

base-commit: 93f51579e7df248780214094418f205253383cc5
--
2.34.1