Fix memory leak in cpufreq_stat
authorsteven finney <Steven.Finney@palm.com>
Mon, 2 May 2011 18:29:17 +0000 (11:29 -0700)
committerSteve Conklin <sconklin@canonical.com>
Fri, 15 Jul 2011 17:20:46 +0000 (12:20 -0500)
commitdfbd05371d0b4d37b4dc9a0e2f3d1de55802594c
treeb7470e5afe96d0c83a7ab6aacdda12241576a577
parentfbc00a676a98d7757f1c1a2a707080fbe8005e9b
Fix memory leak in cpufreq_stat

BugLink: http://bugs.launchpad.net/bugs/793702

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: Tim Gardner <tim.gardner@canonical.com>
drivers/cpufreq/cpufreq_stats.c