]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: ad4062: Add missing IS_ERR() check
authorEthan Tidmore <ethantidmore06@gmail.com>
Sat, 14 Feb 2026 00:53:32 +0000 (18:53 -0600)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 08:24:22 +0000 (08:24 +0000)
commit5cf5654b1975d76dbd2e5696a8a8e81c601e0744
tree9bdbb5c7eb54ad0c3e47f16f28ecd744e439145d
parentbc2cb23607eb0ff99a67e260ec33d01c6e6f1290
iio: adc: ad4062: Add missing IS_ERR() check

In the function ad4062_sizeof_storagebits() iio_get_current_scan_type()
is called which can return an error pointer and is not checked for it.
Also the function ad4062_sizeof_storagebits() returns type size_t but,
is only used once and the variable assigned from it is type u8.

Add check for error pointer in ad4062_sizeof_storagebits() and change
return type to int so the error code can be properly propagated and then
checked.

Fixes: 23cc92280302d ("iio: adc: ad4062: Add IIO Trigger support")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202512280539.AholFF7m-lkp@intel.com/
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad4062.c