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

[Xen-changelog] [xen-unstable] powernow: don't read never initialized structure member



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1320657983 -3600
# Node ID 721a87728b6bc4eaf7c1d1c8b66c6aa90e042011
# Parent  604a90b803d34faa083988771c858dee1efe1a53
powernow: don't read never initialized structure member

c/s 20361:51b031b0737e removed the writing of struct
processor_performance's shared_cpu_map member, but the powernow driver
still has code to read it (though presumably that code path can't be
taken on actual hardware supported by the powernow driver). Remove the
use of the field along with the field itself.

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


diff -r 604a90b803d3 -r 721a87728b6b xen/arch/x86/acpi/cpufreq/powernow.c
--- a/xen/arch/x86/acpi/cpufreq/powernow.c      Fri Nov 04 15:34:50 2011 +0000
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c      Mon Nov 07 10:26:23 2011 +0100
@@ -200,15 +200,17 @@
     perf = data->acpi_data;
     policy->shared_type = perf->shared_type;
 
-    /*
-     * Will let policy->cpus know about dependency only when software
-     * coordination is required.
-     */
     if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
         policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) {
-        policy->cpus = perf->shared_cpu_map;
+        cpumask_set_cpu(cpu, &policy->cpus);
+        if (cpumask_weight(&policy->cpus) != 1) {
+            printk(XENLOG_WARNING "Unsupported sharing type %d (%u CPUs)\n",
+                   policy->shared_type, cpumask_weight(&policy->cpus));
+            result = -ENODEV;
+            goto err_unreg;
+        }
     } else {
-        policy->cpus = cpumask_of_cpu(cpu);    
+        cpumask_copy(&policy->cpus, cpumask_of(cpu));
     }
 
     /* capability check */
diff -r 604a90b803d3 -r 721a87728b6b xen/include/acpi/cpufreq/processor_perf.h
--- a/xen/include/acpi/cpufreq/processor_perf.h Fri Nov 04 15:34:50 2011 +0000
+++ b/xen/include/acpi/cpufreq/processor_perf.h Mon Nov 07 10:26:23 2011 +0100
@@ -29,7 +29,6 @@
     uint32_t state_count;
     struct xen_processor_px *states;
     struct xen_psd_package domain_info;
-    cpumask_t shared_cpu_map;
     uint32_t shared_type;
 
     uint32_t init;

_______________________________________________
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®.