[linux-next:master 3984/6263] drivers/media/i2c/imx678.c:905 imx678_write_common() error: buffer overflow 'link_freqs_reg_value' 8 <= 64

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
BCC: [email protected]
CC: [email protected]
TO: Jai Luthra <[email protected]>
CC: Sakari Ailus <[email protected]>
CC: Tarang Raval <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   cc2b5f627e8ccbae1188ef2d8be3e451d7f933a5
commit: bf40cc53b1e00c312046f6dd88e9054bc91865af [3984/6263] media: i2c: imx678: Add driver for Sony IMX678
:::::: branch date: 9 hours ago
:::::: commit date: 6 days ago
config: loongarch-randconfig-r073-20260714 (https://download.01.org/0day-ci/archive/20260715/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 16.1.0
smatch: v0.5.0-9185-gbcc58b9c

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]/

New smatch warnings:
drivers/media/i2c/imx678.c:905 imx678_write_common() error: buffer overflow 'link_freqs_reg_value' 8 <= 64
drivers/media/i2c/imx678.c:1152 imx678_init_controls() error: buffer overflow 'min_hmax_4lane' 8 <= 64

Old smatch warnings:
arch/loongarch/include/asm/atomic.h:51 arch_atomic_fetch_add_unless() warn: inconsistent indenting

vim +/link_freqs_reg_value +905 drivers/media/i2c/imx678.c

bf40cc53b1e00c Jai Luthra 2026-07-03  895  
bf40cc53b1e00c Jai Luthra 2026-07-03  896  static int imx678_write_common(struct imx678 *imx678)
bf40cc53b1e00c Jai Luthra 2026-07-03  897  {
bf40cc53b1e00c Jai Luthra 2026-07-03  898  	int ret = 0;
bf40cc53b1e00c Jai Luthra 2026-07-03  899  
bf40cc53b1e00c Jai Luthra 2026-07-03  900  	cci_multi_reg_write(imx678->cci, common_regs, ARRAY_SIZE(common_regs),
bf40cc53b1e00c Jai Luthra 2026-07-03  901  			    &ret);
bf40cc53b1e00c Jai Luthra 2026-07-03  902  
bf40cc53b1e00c Jai Luthra 2026-07-03  903  	cci_write(imx678->cci, IMX678_REG_INCK_SEL, imx678->inck_sel_val, &ret);
bf40cc53b1e00c Jai Luthra 2026-07-03  904  	cci_write(imx678->cci, IMX678_REG_DATARATE_SEL,
bf40cc53b1e00c Jai Luthra 2026-07-03 @905  		  link_freqs_reg_value[__ffs(imx678->link_freq_bitmap)], &ret);
bf40cc53b1e00c Jai Luthra 2026-07-03  906  	cci_write(imx678->cci, IMX678_REG_LANEMODE, imx678->lane_mode, &ret);
bf40cc53b1e00c Jai Luthra 2026-07-03  907  
bf40cc53b1e00c Jai Luthra 2026-07-03  908  	cci_write(imx678->cci, IMX678_REG_INTERFACE_SEL, IMX678_INTERFACE_2L_4L,
bf40cc53b1e00c Jai Luthra 2026-07-03  909  		  &ret);
bf40cc53b1e00c Jai Luthra 2026-07-03  910  
bf40cc53b1e00c Jai Luthra 2026-07-03  911  	return ret;
bf40cc53b1e00c Jai Luthra 2026-07-03  912  }
bf40cc53b1e00c Jai Luthra 2026-07-03  913  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.