summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorXueqin Luo <luoxueqin@kylinos.cn>2026-08-25 21:14:00 +0800
committerMario Limonciello <superm1@kernel.org>2026-09-22 16:04:12 -0500
commit50fb9e04c9b1fe822baccba57801e2bc7795552e (patch)
tree3a60f8a1976ba7e6fbf9d04cd4946b6eb20d8600 /tools/perf/scripts/python
parentc8663e0457e6e6c72006478f4b6da99060030ec1 (diff)
cpufreq/amd-pstate: Restore previous EPP if profile_name allocation fails
amd_pstate_set_dynamic_epp() first applies the EPP value derived from the current platform profile via amd_pstate_set_epp() and only then allocates the profile name and registers the platform profile handler and the power supply notifier. All failures after the EPP has been programmed jump to the cleanup label, which restores the previously programmed EPP value. However, if the kasprintf() of the profile name fails, the function returns -ENOMEM directly, bypassing the cleanup label, so the EPP value programmed above is never rolled back even though enabling dynamic EPP has failed. Make the allocation failure path jump to the cleanup label as well, so that the previous EPP value is restored consistently on all error paths. Fixes: b7294b627598 ("cpufreq/amd-pstate: Add dynamic EPP as an "energy_performance_preference" mode") Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn> Link: https://lore.kernel.org/r/20260825131400.1509428-1-luoxueqin@kylinos.cn Signed-off-by: Mario Limonciello <superm1@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions