Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

authored by

Thomas Renninger and committed by
Dominik Brodowski
e0c6082d 0b37ee65

-7
-7
tools/power/cpupower/utils/cpuidle-info.c
··· 35 35 printf(_("CPU %u: Can't read idle state info\n"), cpu); 36 36 return; 37 37 } 38 - tmp = sysfs_get_idlestate_name(cpu, idlestates - 1); 39 - if (!tmp) { 40 - printf(_("Could not determine max idle state %u\n"), 41 - idlestates - 1); 42 - return; 43 - } 44 - 45 38 printf(_("Number of idle states: %d\n"), idlestates); 46 39 printf(_("Available idle states:")); 47 40 for (idlestate = 0; idlestate < idlestates; idlestate++) {