[CPUFREQ] powernow-k7: ACPI perflib unregistration cleanup The unregistration of the ACPI performance library should be done in the CPU exit function, and the cleanup too. Signed-off-by: Dominik Brodowski diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/powernow-k7.c linux/arch/i386/kernel/cpu/cpufreq/powernow-k7.c --- linux-original/arch/i386/kernel/cpu/cpufreq/powernow-k7.c 2004-10-29 17:15:46.000000000 +0200 +++ linux/arch/i386/kernel/cpu/cpufreq/powernow-k7.c 2004-10-29 17:37:31.449171448 +0200 @@ -635,6 +635,17 @@ static int powernow_cpu_exit (struct cpufreq_policy *policy) { cpufreq_frequency_table_put_attr(policy->cpu); + +#ifdef CONFIG_X86_POWERNOW_K7_ACPI + if (acpi_processor_perf) { + acpi_processor_unregister_performance(acpi_processor_perf, 0); + kfree(acpi_processor_perf); + } +#endif + + if (powernow_table) + kfree(powernow_table); + return 0; } @@ -664,15 +675,7 @@ static void __exit powernow_exit (void) { -#ifdef CONFIG_X86_POWERNOW_K7_ACPI - if (acpi_processor_perf) { - acpi_processor_unregister_performance(acpi_processor_perf, 0); - kfree(acpi_processor_perf); - } -#endif cpufreq_unregister_driver(&powernow_driver); - if (powernow_table) - kfree(powernow_table); } module_param(acpi_force, int, 0444);