Commit 5257d80e authored by David Lechner's avatar David Lechner Committed by Jonathan Cameron
Browse files

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: e571c190 ("iio: adc: ad7606: move scale_setup as function pointer on chip-info")
Reviewed-by: default avatarNuno Sá <nuno.sa@analog.com>
Signed-off-by: default avatarDavid 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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent f063a280
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment