Skip to content

Commit

Permalink
cpupower: Remove unneeded code and by that fix a memleak
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
watologo1 authored and Dominik Brodowski committed Mar 3, 2012
1 parent 0b37ee6 commit e0c6082
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions tools/power/cpupower/utils/cpuidle-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit e0c6082

Please sign in to comment.