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-changelog

[Xen-changelog] [xen-unstable] Add protection for xenpm access power man

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Add protection for xenpm access power management info
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Oct 2008 07:50:51 -0700
Delivery-date: Wed, 22 Oct 2008 07:53:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224578888 -3600
# Node ID 27eec3c54d08b8941eb06c1fae6fea5f98013e43
# Parent  a9f299b11b7fd381cc2391687a8367d74eea5bd0
Add protection for xenpm access power management info

Signed-off-by: Liu Jinsong <jinsong.liu@xxxxxxxxx>
---
 xen/drivers/acpi/pmstat.c     |    4 ++--
 xen/drivers/cpufreq/utility.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff -r a9f299b11b7f -r 27eec3c54d08 xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c Tue Oct 21 09:47:33 2008 +0100
+++ b/xen/drivers/acpi/pmstat.c Tue Oct 21 09:48:08 2008 +0100
@@ -52,7 +52,7 @@ int do_get_pm_info(struct xen_sysctl_get
     int ret = 0;
     const struct processor_pminfo *pmpt;
 
-    if ( (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) )
+    if ( !op || (op->cpuid >= NR_CPUS) || !cpu_online(op->cpuid) )
         return -EINVAL;
     pmpt = processor_pminfo[op->cpuid];
 
@@ -87,7 +87,7 @@ int do_get_pm_info(struct xen_sysctl_get
         uint64_t tmp_idle_ns;
         struct pm_px *pxpt = cpufreq_statistic_data[op->cpuid];
 
-        if ( !pxpt )
+        if ( !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt )
             return -ENODATA;
 
         total_idle_ns = get_cpu_idle_time(op->cpuid);
diff -r a9f299b11b7f -r 27eec3c54d08 xen/drivers/cpufreq/utility.c
--- a/xen/drivers/cpufreq/utility.c     Tue Oct 21 09:47:33 2008 +0100
+++ b/xen/drivers/cpufreq/utility.c     Tue Oct 21 09:48:08 2008 +0100
@@ -129,7 +129,7 @@ void cpufreq_statistic_reset(unsigned in
     struct pm_px *pxpt = cpufreq_statistic_data[cpuid];
     const struct processor_pminfo *pmpt = processor_pminfo[cpuid];
 
-    if ( !pxpt || !pmpt )
+    if ( !pmpt || !pxpt || !pxpt->u.pt || !pxpt->u.trans_pt )
         return;
 
     count = pmpt->perf.state_count;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Add protection for xenpm access power management info, Xen patchbot-unstable <=