[CPUFREQ] Remove cpufreq_stats sysfs entries on module unload.
authorDave Jones <davej@redhat.com>
Sun, 12 Jun 2011 20:35:28 +0000 (16:35 -0400)
committerDave Jones <davej@redhat.com>
Sun, 12 Jun 2011 20:36:52 +0000 (16:36 -0400)
cpufreq_stats leaves behind its sysfs entries, which causes a panic
when something stumbled across them.
(Discovered by unloading cpufreq_stats while powertop was loaded).

Signed-off-by: Dave Jones <davej@redhat.com>
Cc: stable@kernel.org
drivers/cpufreq/cpufreq_stats.c

index b60a4c263686ab56693c5df6993e084e8f9f7e29..853f92d23ddb5ed80c8b2836e878422121ae3f5f 100644 (file)
@@ -387,6 +387,7 @@ static void __exit cpufreq_stats_exit(void)
        unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
        for_each_online_cpu(cpu) {
                cpufreq_stats_free_table(cpu);
+               cpufreq_stats_free_sysfs(cpu);
        }
 }