]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Fix memory leak in cpufreq_stat
authorsteven finney <Steven.Finney@palm.com>
Mon, 2 May 2011 18:29:17 +0000 (11:29 -0700)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:50 +0000 (13:54 -0700)
commitc4e60bd6930b93a13432f53dfb70e65d8fef58d2
treef071afd3524cab15c12117ee6497769340b41e56
parentf8c02e3305bdf8656219da21fde9f0b8b31c0508
Fix memory leak in cpufreq_stat

commit 98586ed8b8878e10691203687e89a42fa3355300 upstream.

When a CPU is taken offline in an SMP system, cpufreq_remove_dev()
nulls out the per-cpu policy before cpufreq_stats_free_table() can
make use of it.  cpufreq_stats_free_table() then skips the
call to sysfs_remove_group(), leaving about 100 bytes of sysfs-related
memory unclaimed each time a CPU-removal occurs. Break up
cpu_stats_free_table into sysfs and table portions, and
call the sysfs portion early.

Signed-off-by: Steven Finney <steven.finney@palm.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/cpufreq/cpufreq_stats.c