[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86/powernow: fix machine shutdown



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1225113652 0
# Node ID 101e50cffc7825065f4dd39610728a2ba3ea68b4
# Parent  537d480b7ffc1916a44ca1488bf70d80efac69cb
x86/powernow: fix machine shutdown

cpufreq_del_cpu() calls cpufreq_driver->exit() without checking
whether an exit() handler is present, and by adding an exit() handler
to powernow we can at once close the potential memory leak.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/acpi/cpufreq/powernow.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+)

diff -r 537d480b7ffc -r 101e50cffc78 xen/arch/x86/acpi/cpufreq/powernow.c
--- a/xen/arch/x86/acpi/cpufreq/powernow.c      Mon Oct 27 11:56:57 2008 +0000
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c      Mon Oct 27 13:20:52 2008 +0000
@@ -229,9 +229,23 @@ err_unreg:
     return result;
 }
 
+static int powernow_cpufreq_cpu_exit(struct cpufreq_policy *policy)
+{
+    struct powernow_cpufreq_data *data = drv_data[policy->cpu];
+
+    if (data) {
+        drv_data[policy->cpu] = NULL;
+        xfree(data->freq_table);
+        xfree(data);
+    }
+
+    return 0;
+}
+
 static struct cpufreq_driver powernow_cpufreq_driver = {
     .target = powernow_cpufreq_target,
     .init   = powernow_cpufreq_cpu_init,
+    .exit   = powernow_cpufreq_cpu_exit
 };
 
 int powernow_cpufreq_init(void)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.