Skip to content

Commit d52d2b3

Browse files
committed
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/[email protected] Signed-off-by: Shuah Khan <[email protected]>
1 parent 80d3175 commit d52d2b3

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)