linux/drivers/hwmon/peci
Sanman Pradhan b0c9d8ae71 hwmon: (peci/cputemp) Fix off-by-one in cputemp_is_visible()
cputemp_is_visible() validates the channel index against
CPUTEMP_CHANNEL_NUMS, but currently uses '>' instead of '>='.
As a result, channel == CPUTEMP_CHANNEL_NUMS is not rejected even though
valid indices are 0 .. CPUTEMP_CHANNEL_NUMS - 1.

Fix the bounds check by using '>=' so invalid channel indices are
rejected before indexing the core bitmap.

Fixes: bf3608f338 ("hwmon: peci: Add cputemp driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sanman Pradhan <psanman@juniper.net>
Link: https://lore.kernel.org/r/20260323002352.93417-3-sanman.pradhan@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-03-24 07:55:34 -07:00
..
common.h hwmon: (peci) Rely on subsystem locking 2025-10-17 07:18:06 -07:00
cputemp.c hwmon: (peci/cputemp) Fix off-by-one in cputemp_is_visible() 2026-03-24 07:55:34 -07:00
dimmtemp.c hwmon: (peci) Rely on subsystem locking 2025-10-17 07:18:06 -07:00
Kconfig
Makefile