mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 17:42:03 +02:00
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:
parent
124e2dbabe
commit
e45d6b8472
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user