platform/x86: ISST: Validate max level for set feature

Validate the level before setting, so that it fails early instead of
failing later when checking the bit mask for allowed levels.

Fixes: ea009e4769 ("platform/x86: ISST: Add SST-PP support via TPMI")
Cc: stable@vger.kernel.org
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20260811221514.3905817-3-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
Srinivas Pandruvada 2026-08-11 15:15:10 -07:00 committed by Ilpo Järvinen
parent 124e2dbabe
commit e45d6b8472
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31

View File

@ -947,6 +947,9 @@ static int isst_if_set_perf_level(void __user *argp)
if (!power_domain_info)
return -EINVAL;
if (perf_level.level > power_domain_info->max_level)
return -EINVAL;
if (power_domain_info->write_blocked || !capable(CAP_SYS_ADMIN))
return -EPERM;