From: Prarit Bhargava <prarit@redhat.com> Date: Mon, 1 Dec 2008 09:47:59 -0500 Subject: [acpi] acpi_cpufreq: fix panic when removing module Message-id: 20081201144758.17822.1507.sendpatchset@prarit.bos.redhat.com O-Subject: [RHEL5.3 PATCH]: Fix panic when removing acpi_cpufreq module Bugzilla: 472844 RH-Acked-by: Pete Zaitcev <zaitcev@redhat.com> Commit d63b373f11aabddade9f0f8574242ea1a75d587a introduced a panic in acpi_cpufreq_exit(). This went unnoticed until we changed acpi-cpufreq to a module. acpi_perf_data is not a percpu variable. Treat it accordingly when exitting. Successfully compiled and tested by me. diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c index f873c77..574702a 100644 --- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -791,11 +791,16 @@ static int __init acpi_cpufreq_init(void) static void __exit acpi_cpufreq_exit(void) { + unsigned int i; + dprintk("acpi_cpufreq_exit\n"); cpufreq_unregister_driver(&acpi_cpufreq_driver); - free_percpu(acpi_perf_data); + for_each_possible_cpu(i) { + kfree(acpi_perf_data[i]); + acpi_perf_data[i] = NULL; + } return; }