Skip to contentSkip to conversation

powernow-k7: unregistering from ACPI perflib in ->exit(), do kfree in ->exit()

PATCH New Dominik Brodowski 1 participant 1 message Oct 8, 2004

lore
Share & tools
lore
#0 lore raw

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.

arch/i386/kernel/cpu/cpufreq/powernow-k7.c +11 -8
diff -ruN linux-original/arch/i386/kernel/cpu/cpufreq/powernow-k7.c linux/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -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);