From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Arnav Kapoor <kapoorarnav43@gmail.com>
Cc: "Marius Cristea" <marius.cristea@microchip.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: mcp3564: reject devices without match data
Date: Thu, 22 Oct 2026 19:41:58 +0300 [thread overview]
Message-ID: <ato81kWiI4gnI5xK@ashevche-desk.local> (raw)
In-Reply-To: <20261021225431.627718-1-kapoorarnav43@gmail.com>
On Thu, Oct 22, 2026 at 04:24:28AM +0530, Arnav Kapoor wrote:
> The driver identifies the chip by reading its ID registers. If that
> fails, e.g. for a newer part number, it falls back to the match data
> provided by the device tree.
>
> spi_get_device_match_data() returns NULL when the device is bound with
> the "spi: override" property, as in that case no match data is set and
> the device name doesn't match any of the entries of the driver's id
> table.
>
> The driver dereferences the returned pointer without checking it, which
> leads to a NULL pointer dereference and a kernel oops.
>
> Return -ENODATA if no match data is available, like the other IIO SPI
> drivers do.
Fine, but I hope we will have something to land to actually do it differently
for the drivers that don't want to use driver_override mechanism.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Please, shrink the commit message to the point.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-10-22 16:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 22:54 Arnav Kapoor
2026-10-22 16:41 ` Andy Shevchenko [this message]
2026-10-22 16:44 ` Arnav Kapoor
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=ato81kWiI4gnI5xK@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=kapoorarnav43@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marius.cristea@microchip.com \
--cc=nuno.sa@analog.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®