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] acpi/pmstat.c: refer to the array after range check.

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] acpi/pmstat.c: refer to the array after range check.
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Fri, 10 Oct 2008 11:32:35 +0900
Cc: guanqun.lu@xxxxxxxxx, ke.yu@xxxxxxxxx
Delivery-date: Thu, 09 Oct 2008 19:32:57 -0700
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
User-agent: Mutt/1.5.6i
acpi/pmstat.c: refer to the array after range check.

make reference to the array after range check.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 16553e1f90dd xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c Fri Oct 10 11:30:17 2008 +0900
+++ b/xen/drivers/acpi/pmstat.c Fri Oct 10 11:31:55 2008 +0900
@@ -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 )
     {


-- 
yamahata

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] acpi/pmstat.c: refer to the array after range check., Isaku Yamahata <=