aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorJinjie Ruan <[email protected]>2024-11-06 09:12:38 +0800
committerViresh Kumar <[email protected]>2024-11-11 09:45:16 +0530
commitbe392aa80f1e5b0b65ccc2a540b9304fefcfe3d8 (patch)
treedc22e932d6165adca1def9547ce5adb35ea46066 /tools/perf/scripts/python/stackcollapse.py
parentdb01e46689e9a986ca6b5d2f41b57d7a81551a4f (diff)
cpufreq: CPPC: Fix wrong return value in cppc_get_cpu_cost()
cppc_get_cpu_cost() return 0 if the policy is NULL. Then in em_compute_costs(), the later zero check for cost is not valid as cost is uninitialized. As Quentin pointed out, kernel energy model core check the return value of get_cost() first, so if the callback failed it should tell the core. Return -EINVAL to fix it. Fixes: 1a1374bb8c59 ("cpufreq: CPPC: Fix possible null-ptr-deref for cppc_get_cpu_cost()") Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Jinjie Ruan <[email protected]> Suggested-by: Quentin Perret <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions