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 -Warray-bounds warning in drivers/base/arch_topology.c #326

Open GustavoARSilva opened 1 year ago

GustavoARSilva commented 1 year ago

Found after building (next-20230622) risc64 with defconfig:

drivers/base/arch_topology.c: In function 'update_siblings_masks':
drivers/base/arch_topology.c:734:67: warning: array subscript 64 is above array bounds of 'struct cpu_topology[64]' [-Warray-bounds=]
  734 |         struct cpu_topology *cpu_topo, *cpuid_topo = &cpu_topology[cpuid];
      |                                                       ~~~~~~~~~~~~^~~~~~~