Skip to content

Commit 92fdd2f

Browse files
committed
pm: cpupower: Fix cmd_monitor() error legs to free cpu_topology
JIRA: https://issues.redhat.com/browse/RHEL-118182 commit d52d2b3 Author: Shuah Khan <skhan@linuxfoundation.org> Date: Wed Mar 5 15:53:39 2025 -0700 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> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 21fd499 commit 92fdd2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,13 @@ int cmd_monitor(int argc, char **argv)
427427

428428
if (avail_monitors == 0) {
429429
printf(_("No HW Cstate monitors found\n"));
430+
cpu_topology_release(cpu_top);
430431
return 1;
431432
}
432433

433434
if (mode == list) {
434435
list_monitors();
436+
cpu_topology_release(cpu_top);
435437
exit(EXIT_SUCCESS);
436438
}
437439

0 commit comments

Comments
 (0)