tools/power/x86/intel-speed-select: Add missing free cpuset

During perf level change cpuset is allocated but not freed.
Add free_cpu_set() in success and failure path.

Although this is not an issue, as the program will exit after
processing of online/offline, but for completeness add the
free_cpu_set().

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
This commit is contained in:
Srinivas Pandruvada 2023-02-22 03:26:29 -08:00
parent 137ba3b13a
commit 57797f19d5
1 changed files with 3 additions and 1 deletions

View File

@ -1271,7 +1271,7 @@ display_result:
ret = isst_get_coremask_info(id, tdp_level, &ctdp_level);
if (ret) {
isst_display_error_info_message(1, "Can't get coremask, online/offline option is ignored", 0, 0);
return;
goto free_mask;
}
if (ctdp_level.cpu_count) {
int i, max_cpus = get_topo_max_cpus();
@ -1288,6 +1288,8 @@ display_result:
}
}
}
free_mask:
free_cpu_set(ctdp_level.core_cpumask);
}
}