summaryrefslogtreecommitdiffstats
path: root/tools/power
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-07-18 15:17:17 +0200
committerHans de Goede <hdegoede@redhat.com>2022-07-28 19:41:07 +0200
commitd9f74d98bbec978edbf860f729b531281ba0d8ff (patch)
tree33ef192dfd4ff4b0a0b32293df87e6e156cbf152 /tools/power
parentplatform/surface: tabletsw: Fix __le32 integer access (diff)
downloadlinux-d9f74d98bbec978edbf860f729b531281ba0d8ff.tar.xz
linux-d9f74d98bbec978edbf860f729b531281ba0d8ff.zip
tools/power/x86/intel-speed-select: Fix off by one check
Change > MAX_DIE_PER_PACKAGE to >= MAX_DIE_PER_PACKAGE to prevent accessing one element beyond the end of the array. Fixes: 7fd786dfbd2c ("tools/power/x86/intel-speed-select: OOB daemon mode") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/x86/intel-speed-select/isst-daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-daemon.c b/tools/power/x86/intel-speed-select/isst-daemon.c
index dd372924bc82..d0400c6684ba 100644
--- a/tools/power/x86/intel-speed-select/isst-daemon.c
+++ b/tools/power/x86/intel-speed-select/isst-daemon.c
@@ -41,7 +41,7 @@ void process_level_change(int cpu)
time_t tm;
int ret;
- if (pkg_id >= MAX_PACKAGE_COUNT || die_id > MAX_DIE_PER_PACKAGE) {
+ if (pkg_id >= MAX_PACKAGE_COUNT || die_id >= MAX_DIE_PER_PACKAGE) {
debug_printf("Invalid package/die info for cpu:%d\n", cpu);
return;
}