Skip to content

Commit

Permalink
tools/power/x86/intel-speed-select: Add missing free cpuset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Srinivas Pandruvada committed Mar 22, 2023
1 parent 137ba3b commit 57797f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/power/x86/intel-speed-select/isst-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ static void set_tdp_level_for_cpu(struct isst_id *id, void *arg1, void *arg2, vo
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();
Expand All @@ -1288,6 +1288,8 @@ static void set_tdp_level_for_cpu(struct isst_id *id, void *arg1, void *arg2, vo
}
}
}
free_mask:
free_cpu_set(ctdp_level.core_cpumask);
}
}

Expand Down

0 comments on commit 57797f1

Please sign in to comment.