ia64/xen-unstable

changeset 18607:a175b2c039ed

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

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Oct 10 10:00:54 2008 +0100 (2008-10-10)
parents 8f5a67f466e2
children 3c0862d49df7
files xen/drivers/acpi/pmstat.c
line diff
     1.1 --- a/xen/drivers/acpi/pmstat.c	Fri Oct 10 10:00:21 2008 +0100
     1.2 +++ b/xen/drivers/acpi/pmstat.c	Fri Oct 10 10:00:54 2008 +0100
     1.3 @@ -50,10 +50,11 @@ extern int pmstat_reset_cx_stat(uint32_t
     1.4  int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
     1.5  {
     1.6      int ret = 0;
     1.7 -    const struct processor_pminfo *pmpt = processor_pminfo[op->cpuid];
     1.8 +    const struct processor_pminfo *pmpt;
     1.9  
    1.10      if ( (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) )
    1.11          return -EINVAL;
    1.12 +    pmpt = processor_pminfo[op->cpuid];
    1.13  
    1.14      switch ( op->type & PMSTAT_CATEGORY_MASK )
    1.15      {