]> git.baikalelectronics.ru Git - kernel.git/commit
[CPUFREQ] Fix memory leak in cpufreq_stat
authorsteven finney <Steven.Finney@palm.com>
Mon, 2 May 2011 18:29:17 +0000 (11:29 -0700)
committerDave Jones <davej@redhat.com>
Wed, 4 May 2011 15:50:57 +0000 (11:50 -0400)
commitf2d9379da85e535ff00bb8a5590d55b25f8b70a2
tree728275611557268583bac0232c90b928151e3c66
parent7c997ba61942e9c0aef0ea52a5f7b4b8b0e49f4d
[CPUFREQ] Fix memory leak in cpufreq_stat

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>
Cc: stable@kernel.org
drivers/cpufreq/cpufreq_stats.c