]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad7606: check for NULL before calling sw_mode_config()
authorDavid Lechner <dlechner@baylibre.com>
Tue, 18 Mar 2025 22:52:09 +0000 (17:52 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 7 Apr 2025 18:32:49 +0000 (19:32 +0100)
commit5257d80e22bf27009d6742e4c174f42cfe54e425
treed38da90512ad4e7bcd65bf20bef98d660084135b
parentf063a28002e3350088b4577c5640882bf4ea17ea
iio: adc: ad7606: check for NULL before calling sw_mode_config()

Check that the sw_mode_config function pointer is not NULL before
calling it. Not all buses define this callback, which resulted in a NULL
pointer dereference.

Fixes: e571c1902116 ("iio: adc: ad7606: move scale_setup as function pointer on chip-info")
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250318-iio-adc-ad7606-improvements-v2-1-4b605427774c@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7606.c