Skip to content
Commit 9e58e3a6 authored by Fabrizio Lamarque's avatar Fabrizio Lamarque Committed by Jonathan Cameron
Browse files

iio: adc: ad7192: Fix null ad7192_state pointer access



Pointer to indio_dev structure is obtained via spi_get_drvdata() at
the beginning of function ad7192_setup(), but the spi->dev->driver_data
member is not initialized, hence a NULL pointer is returned.

Fix by changing ad7192_setup() signature to take pointer to struct
iio_dev, and get ad7192_state pointer via st = iio_priv(indio_dev);

Fixes: bd5dcdeb ("iio: adc: ad7192: convert to device-managed functions")
Signed-off-by: default avatarFabrizio Lamarque <fl.scratchpad@gmail.com>
Reviewed-by: default avatarNuno Sa <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230530075311.400686-2-fl.scratchpad@gmail.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a4cba07e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment