Skip to contentSkip to conversation

drivers/iio/adc/ad4062.c:806 ad4062_sizeof_storagebits() error: 'scan_type' dereferencing possible ERR_PTR()

PATCH kernel test robot 1 participant 1 message Dec 27, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

BCC: [email protected]
CC: [email protected]
TO: Jorge Marques <[email protected]>
CC: Jonathan Cameron <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head:   cdffe36e1cf26b53250ed99d70c71c34ff5d4ac5
commit: 26e26d404918dbe6ae2c04b68f59b07364e77974 [56/65] iio: adc: ad4062: Add IIO Trigger support

:::::: branch date: 3 hours ago
:::::: commit date: 5 hours ago
config: csky-randconfig-r071-20251228 (https://download.01.org/0day-ci/archive/20251228/[email protected]/config)
compiler: csky-linux-gcc (GCC) 15.1.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
drivers/iio/adc/ad4062.c:806 ad4062_sizeof_storagebits() error: 'scan_type' dereferencing possible ERR_PTR()

vim +/scan_type +806 drivers/iio/adc/ad4062.c

f752ac3ab77fca Jorge Marques 2025-12-17  796  
26e26d404918db Jorge Marques 2025-12-17  797  /*
26e26d404918db Jorge Marques 2025-12-17  798   * The AD4062 in burst averaging mode increases realbits from 16-bits to
26e26d404918db Jorge Marques 2025-12-17  799   * 20-bits, increasing the storagebits from 16-bits to 32-bits.
26e26d404918db Jorge Marques 2025-12-17  800   */
26e26d404918db Jorge Marques 2025-12-17  801  static inline size_t ad4062_sizeof_storagebits(struct ad4062_state *st)
26e26d404918db Jorge Marques 2025-12-17  802  {
26e26d404918db Jorge Marques 2025-12-17  803  	const struct iio_scan_type *scan_type =
26e26d404918db Jorge Marques 2025-12-17  804  		iio_get_current_scan_type(st->indio_dev, st->chip->channels);
26e26d404918db Jorge Marques 2025-12-17  805  

26e26d404918db Jorge Marques 2025-12-17 @806 return BITS_TO_BYTES(scan_type->storagebits);
26e26d404918db Jorge Marques 2025-12-17 807 }
26e26d404918db Jorge Marques 2025-12-17 808

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki