Skip to contentSkip to conversation

acpi/pmstat.c: refer to the array after range check.

PATCH New Isaku Yamahata 1 participant 1 message Oct 10, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi/pmstat.c: refer to the array after range check.

acpi/pmstat.c: refer to the array after range check.

make reference to the array after range check.

xen/drivers/acpi/pmstat.c +2 -1
diff -r 16553e1f90dd xen/drivers/acpi/pmstat.c
@@ -50,10 +50,11 @@
 int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
 {
     int ret = 0;
-    const struct processor_pminfo *pmpt = processor_pminfo[op->cpuid];
+    const struct processor_pminfo *pmpt;
 
     if ( (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) )
         return -EINVAL;
+    pmpt = processor_pminfo[op->cpuid];
 
     switch ( op->type & PMSTAT_CATEGORY_MASK )
     {
Signature · 1 line
yamahata