]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: ad7280a: handle spi_setup() errors in probe()
authorPavel Zhigulin <Pavel.Zhigulin@kaspersky.com>
Fri, 14 Nov 2025 15:13:01 +0000 (18:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:27:35 +0000 (10:27 +0100)
commitce8d8a3368128af0ba308bda3923d0aa32152867
tree88243d8bda72f241f991776b9792c8d34ab9a179
parent7673167fac9323110973a3300637adba7d45de3a
iio: adc: ad7280a: handle spi_setup() errors in probe()

[ Upstream commit 6b39824ac4c15783787e6434449772bfb2e31214 ]

The probe() function ignored the return value of spi_setup(), leaving SPI
configuration failures undetected. If spi_setup() fails, the driver should
stop initialization and propagate the error to the caller.

Add proper error handling: check the return value of spi_setup() and return
it on failure.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 2051f25d2a26 ("iio: adc: New driver for AD7280A Lithium Ion Battery Monitoring System")
Signed-off-by: Pavel Zhigulin <Pavel.Zhigulin@kaspersky.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/adc/ad7280a.c