mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/9] iio: adc: reject SPI devices without match data
@ 2026-09-25 12:57 Jiale Yao
  2026-09-25 12:57 ` [PATCH 1/9] iio: adc: ad7192: reject " Jiale Yao
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Jiale Yao @ 2026-09-25 12:57 UTC (permalink / raw)
  To: Alisa-Dariana Roman, Nuno Sá,
	Michael Hennerich, Jonathan Cameron, David Lechner,
	Andy Shevchenko, Ramona Bolboaca, Marcus Folkesson,
	Kent Gustavsson, Matti Vaittinen, Kurt Borja,
	Uwe Kleine-König (The Capable Hub),
	David Jander, Danilo Krummrich, Linus Walleij, Dmitry Torokhov,
	Bartosz Golaszewski, Guillaume Stols, Jonathan Santos,
	Krzysztof Kozlowski, Oleksij Rempel, linux-iio, linux,
	linux-kernel
  Cc: Jiale Yao

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-09-26  1:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25 12:57 [PATCH 0/9] iio: adc: reject SPI devices without match data Jiale Yao
2026-09-25 12:57 ` [PATCH 1/9] iio: adc: ad7192: reject " Jiale Yao
2026-09-25 12:57 ` [PATCH 2/9] iio: adc: ad7606: " Jiale Yao
2026-09-25 12:57 ` [PATCH 3/9] iio: adc: ad7768-1: " Jiale Yao
2026-09-25 12:57 ` [PATCH 4/9] iio: adc: max11205: " Jiale Yao
2026-09-25 12:57 ` [PATCH 5/9] iio: adc: mcp3911: " Jiale Yao
2026-09-25 12:57 ` [PATCH 6/9] iio: adc: ti-adc128s052: validate SPI " Jiale Yao
2026-09-26  1:15   ` Jonathan Cameron
2026-09-26  1:18     ` Jonathan Cameron
2026-09-25 12:57 ` [PATCH 7/9] iio: adc: ti-ads1018: reject devices without " Jiale Yao
2026-09-25 19:24   ` Kurt Borja
2026-09-25 12:57 ` [PATCH 8/9] iio: adc: ti-ads131m02: " Jiale Yao
2026-09-25 12:57 ` [PATCH 9/9] iio: adc: ti-ads7950: validate SPI " Jiale Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®