]> 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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Jun 2011 22:28:33 +0000 (15:28 -0700)
commit730fcde3210042e16d8787f48b3f05eebf5d65f1
treeb259a76f1ebbf47015c0fb9b7698f2b393529fef
parent761a310ee4c08a0c38a73663822001c67806acd8
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