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>
This commit is contained in:
parent
80d3175a7e
commit
d52d2b311a
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue