From: Jiale Yao <yaojiale02@163.com>
To: "Alisa-Dariana Roman" <alisa.roman@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Ramona Bolboaca" <ramona.bolboaca@analog.com>,
"Marcus Folkesson" <marcus.folkesson@gmail.com>,
"Kent Gustavsson" <kent@minoris.se>,
"Matti Vaittinen" <mazziesaccount@gmail.com>,
"Kurt Borja" <kuurtb@gmail.com>,
"Uwe Kleine-König (The Capable Hub)"
<u.kleine-koenig@baylibre.com>,
"David Jander" <david@protonic.nl>,
"Danilo Krummrich" <dakr@kernel.org>,
"Linus Walleij" <linusw@kernel.org>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>,
"Guillaume Stols" <gstols@baylibre.com>,
"Jonathan Santos" <Jonathan.Santos@analog.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Oleksij Rempel" <o.rempel@pengutronix.de>,
linux-iio@vger.kernel.org, linux@analog.com,
linux-kernel@vger.kernel.org
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH 0/9] iio: adc: reject SPI devices without match data
Date: Fri, 25 Sep 2026 20:57:38 +0800 [thread overview]
Message-ID: <20260925125754.2162337-1-yaojiale02@163.com> (raw)
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
next reply other threads:[~2026-09-25 12:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 12:57 Jiale Yao [this message]
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-27 17:45 ` 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
2026-09-27 17:49 ` [PATCH 0/9] iio: adc: reject SPI devices without " Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260925125754.2162337-1-yaojiale02@163.com \
--to=yaojiale02@163.com \
--cc=Jonathan.Santos@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=alisa.roman@analog.com \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=dakr@kernel.org \
--cc=david@protonic.nl \
--cc=dlechner@baylibre.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gstols@baylibre.com \
--cc=jic23@kernel.org \
--cc=kent@minoris.se \
--cc=krzk@kernel.org \
--cc=kuurtb@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=marcus.folkesson@gmail.com \
--cc=mazziesaccount@gmail.com \
--cc=nuno.sa@analog.com \
--cc=o.rempel@pengutronix.de \
--cc=ramona.bolboaca@analog.com \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®