WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] powernow: implement struct cpufreq_driver.verify

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] powernow: implement struct cpufreq_driver.verify
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 05 Dec 2008 14:22:07 +0000
Delivery-date: Fri, 05 Dec 2008 06:21:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Without this, under rare conditions hypervisor crashes are possible due
to this method being called without checking against NULL.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2008-11-20/xen/arch/x86/acpi/cpufreq/powernow.c
===================================================================
--- 2008-11-20.orig/xen/arch/x86/acpi/cpufreq/powernow.c        2008-11-05 
16:54:22.000000000 +0100
+++ 2008-11-20/xen/arch/x86/acpi/cpufreq/powernow.c     2008-12-03 
11:56:27.000000000 +0100
@@ -129,6 +129,16 @@ static int powernow_cpufreq_target(struc
     return result;
 }
 
+static int powernow_cpufreq_verify(struct cpufreq_policy *policy)
+{
+    struct powernow_cpufreq_data *data;
+
+    if (!policy || !(data = drv_data[policy->cpu]))
+        return -EINVAL;
+
+    return cpufreq_frequency_table_verify(policy, data->freq_table);
+}
+
 static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
     unsigned int i;
@@ -243,6 +253,7 @@ static int powernow_cpufreq_cpu_exit(str
 }
 
 static struct cpufreq_driver powernow_cpufreq_driver = {
+    .verify = powernow_cpufreq_verify,
     .target = powernow_cpufreq_target,
     .init   = powernow_cpufreq_cpu_init,
     .exit   = powernow_cpufreq_cpu_exit




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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] powernow: implement struct cpufreq_driver.verify, Jan Beulich <=