hwmon: (peci/cputemp) Fix off-by-one in coretemp_label allocation
authorZev Weiss <zev@bewilderbeest.net>
Thu, 2 Feb 2023 02:18:25 +0000 (18:18 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 3 Feb 2023 15:27:25 +0000 (07:27 -0800)
commitf00093608fa790580da309bb9feb5108fbe7c331
tree462d19b64dfe38d71caf22ce20341624f16a424d
parent2fbb848b65cde5b876cce52ebcb34de4aaa5a94a
hwmon: (peci/cputemp) Fix off-by-one in coretemp_label allocation

The find_last_bit() call produces the index of the highest-numbered
core in core_mask; because cores are numbered from zero, the number of
elements we need to allocate is one more than that.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Cc: stable@kernel.org # v5.18
Fixes: bf3608f338e9 ("hwmon: peci: Add cputemp driver")
Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>
Link: https://lore.kernel.org/r/20230202021825.21486-1-zev@bewilderbeest.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/peci/cputemp.c