tree:
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head: 283d2403beb406f0906cfbb2c9d7aa61cbcbbeed
commit: 77ed24daa40b3ce41610268d8307a50d82b382ad [17/95] iio: light: as73211: New driver
config: mips-randconfig-m031-20200831 (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/iio/light/as73211.c:213 as73211_integration_time_calc_avail() error: buffer
overflow 'data->int_time_avail' 30 <= 58
#
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=...
git remote add iio
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git fetch --no-tags iio testing
git checkout 77ed24daa40b3ce41610268d8307a50d82b382ad
vim +213 drivers/iio/light/as73211.c
77ed24daa40b3c Christian Eggers 2020-08-05 206 static void
as73211_integration_time_calc_avail(struct as73211_data *data)
77ed24daa40b3c Christian Eggers 2020-08-05 207 {
77ed24daa40b3c Christian Eggers 2020-08-05 208 int i;
77ed24daa40b3c Christian Eggers 2020-08-05 209
77ed24daa40b3c Christian Eggers 2020-08-05 210 for (i = 0; i <
ARRAY_SIZE(data->int_time_avail); i++) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77ed24daa40b3c Christian Eggers 2020-08-05 211 unsigned int time_us =
as73211_integration_time_us(data, BIT(i));
77ed24daa40b3c Christian Eggers 2020-08-05 212
77ed24daa40b3c Christian Eggers 2020-08-05 @213 data->int_time_avail[i * 2 + 0] =
time_us / USEC_PER_SEC;
^^^^^^^^^
Buffer overflow
77ed24daa40b3c Christian Eggers 2020-08-05 214 data->int_time_avail[i * 2 + 1] =
time_us % USEC_PER_SEC;
^^^^^^^^^^^^^^^^^^^^^^^^
77ed24daa40b3c Christian Eggers 2020-08-05 215 }
77ed24daa40b3c Christian Eggers 2020-08-05 216 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org