Fix memory leak in cpufreq_stat
commita5ba67df5b332a1e9bd73f6954285a3284f86e71
authorsteven finney <Steven.Finney@palm.com>
Mon, 2 May 2011 18:29:17 +0000 (2 11:29 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Jun 2011 01:33:34 +0000 (3 10:33 +0900)
treee25fea3102840eed4d1c0c4308a8ef2259fc2eb4
parent15ae4738537b75bb8f9ba737bcb18c8cb0cb1e07
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>
drivers/cpufreq/cpufreq_stats.c