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] [XEN] perf counters: Fix NULL-pointer che

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] perf counters: Fix NULL-pointer check. Should happen later.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Oct 2006 18:30:15 +0000
Delivery-date: Fri, 27 Oct 2006 11:30:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kaf24@xxxxxxxxxxxxxxxxxxxxx
# Node ID 3d347263e5d8a5496498a46ddb1662b49bbb016c
# Parent  ee140fbcb88df2e55259b0c6519de7645641468a
[XEN] perf counters: Fix NULL-pointer check. Should happen later.
Signed-of-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
---
 xen/common/perfc.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff -r ee140fbcb88d -r 3d347263e5d8 xen/common/perfc.c
--- a/xen/common/perfc.c        Fri Oct 27 18:02:40 2006 +0100
+++ b/xen/common/perfc.c        Fri Oct 27 18:10:37 2006 +0100
@@ -143,9 +143,6 @@ static int perfc_copy_info(XEN_GUEST_HAN
     unsigned int v = 0;
     atomic_t *counters = (atomic_t *)&perfcounters;
 
-    if ( guest_handle_is_null(desc) )
-        return 0;
-
     /* We only copy the name and array-size information once. */
     if ( !perfc_init ) 
     {
@@ -175,7 +172,11 @@ static int perfc_copy_info(XEN_GUEST_HAN
         perfc_vals = xmalloc_array(xen_sysctl_perfc_val_t, perfc_nbr_vals);
         perfc_init = 1;
     }
-    if (perfc_vals == NULL)
+
+    if ( guest_handle_is_null(desc) )
+        return 0;
+
+    if ( perfc_vals == NULL )
         return -ENOMEM;
 
     /* Architecture may fill counters from hardware.  */
@@ -207,9 +208,9 @@ static int perfc_copy_info(XEN_GUEST_HAN
     }
     BUG_ON(v != perfc_nbr_vals);
 
-    if (copy_to_guest(desc, (xen_sysctl_perfc_desc_t *)perfc_d, NR_PERFCTRS))
+    if ( copy_to_guest(desc, (xen_sysctl_perfc_desc_t *)perfc_d, NR_PERFCTRS) )
         return -EFAULT;
-    if (copy_to_guest(val, perfc_vals, perfc_nbr_vals))
+    if ( copy_to_guest(val, perfc_vals, perfc_nbr_vals) )
         return -EFAULT;
     return 0;
 }

_______________________________________________
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] [XEN] perf counters: Fix NULL-pointer check. Should happen later., Xen patchbot-unstable <=