forked from pool/cpupower
Thomas Renninger
ea05dcce34
- Fix two bugs: memleak in idle-info and wrong idle state count OBS-URL: https://build.opensuse.org/package/show/hardware/cpupower?expand=0&rev=12
35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
cpupower: Remove unneeded code and by that fix a memleak
|
|
|
|
Looks like some not needed debug code slipped in.
|
|
Also this code:
|
|
tmp = sysfs_get_idlestate_name(cpu, idlestates - 1);
|
|
performs a strdup and the mem was not freed again.
|
|
-> delete it.
|
|
|
|
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
|
CC: cpufreq@vger.kernel.org
|
|
CC: linux@dominikbrodowski.net
|
|
|
|
---
|
|
tools/power/cpupower/utils/cpuidle-info.c | 7 -------
|
|
1 files changed, 0 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/utils/cpuidle-info.c b/utils/cpuidle-info.c
|
|
index e076beb..8145af5 100644
|
|
--- a/utils/cpuidle-info.c
|
|
+++ b/utils/cpuidle-info.c
|
|
@@ -35,13 +35,6 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose)
|
|
printf(_("CPU %u: Can't read idle state info\n"), cpu);
|
|
return;
|
|
}
|
|
- tmp = sysfs_get_idlestate_name(cpu, idlestates - 1);
|
|
- if (!tmp) {
|
|
- printf(_("Could not determine max idle state %u\n"),
|
|
- idlestates - 1);
|
|
- return;
|
|
- }
|
|
-
|
|
printf(_("Number of idle states: %d\n"), idlestates);
|
|
printf(_("Available idle states:"));
|
|
for (idlestate = 0; idlestate < idlestates; idlestate++) {
|