powernow-k7: unregistering from ACPI perflib in ->exit(), do kfree in ->exit()
PATCH 1/1 powernow-k7: unregistering from ACPI perflib in ->exit(), do kfree in ->exit()
The unregistration of the ACPI performance library should be done in the CPU exit function, and the cleanup too.
Signed-off-by Dominik Brodowski <[email protected]>
arch/i386/kernel/cpu/cpufreq/powernow-k7.c +11 -8
@@ -632,6 +632,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 ; }
@@ -661,15 +672,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 );