KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
82 stars 5 forks source link

Address -Wstringop-overflow in drivers/hwmon/pc87360.c #341

Closed GustavoARSilva closed 8 months ago

GustavoARSilva commented 1 year ago

Reported-by: kernel test robot: https://lore.kernel.org/lkml/202308161610.uARLhZlY-lkp@intel.com/

See under arm64 with allyesconfig

drivers/hwmon/pc87360.c:341:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 337                         if (data->in_status[i] & CHAN_ENA) {
 338                                 data->in_min[i] = pc87360_read_value(data,
 339                                                   LD_IN, i,
 340                                                   PC87365_REG_IN_MIN);
@ 341                                 data->in_max[i] = pc87360_read_value(data,
 342                                                   LD_IN, i,
 343                                                   PC87365_REG_IN_MAX);
 344                                 if (i >= 11)
 345                                         data->in_crit[i-11] =
 346                                                 pc87360_read_value(data, LD_IN,
 347                                                 i, PC87365_REG_TEMP_CRIT);
 348                         }
kees commented 8 months ago

Fixed with commit 4265eb062a7303e537ab3792ade31f424c3c5189