diff options
author | Shuah Khan <skhan@linuxfoundation.org> | 2025-03-05 15:53:39 -0700 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2025-03-06 13:27:38 -0700 |
commit | d52d2b311a5a251ddd723d1dac881dc46e8803ab (patch) | |
tree | fc2ddfda18be77b9ab2a20b0bd46cbe9170629f8 | |
parent | 80d3175a7e073fad281bdc5c7e881f46ab806d97 (diff) |
pm: cpupower: Fix cmd_monitor() error legs to free cpu_topology
cmd_monitor() calls get_cpu_topology() to allocate memory for
cpu topology and fails to release in error legs.
Fix it to call cpu_topology_release() from error legs.
Link: https://lore.kernel.org/r/20250305225342.19447-2-skhan@linuxfoundation.org
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
-rw-r--r-- | tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c index e123aa578881..0380d2e70016 100644 --- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c +++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c @@ -427,11 +427,13 @@ int cmd_monitor(int argc, char **argv) if (avail_monitors == 0) { printf(_("No HW Cstate monitors found\n")); + cpu_topology_release(cpu_top); return 1; } if (mode == list) { list_monitors(); + cpu_topology_release(cpu_top); exit(EXIT_SUCCESS); } |