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-3.1-testing] Clean up and fix XEN_SYSCTL_getcpuinfo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] Clean up and fix XEN_SYSCTL_getcpuinfo error path.
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 04 Oct 2007 08:40:22 -0700
Delivery-date: Thu, 04 Oct 2007 09:27:21 -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 Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1191318452 -3600
# Node ID c4f30c4a8540933f411804488847530b15a3da9f
# Parent  a86cf1d18625644eb04a50a6b65c7154d3e18b81
Clean up and fix XEN_SYSCTL_getcpuinfo error path.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset:   15999:8c67b2038ff2de2b7a75c1f81adb971931f54ceb
xen-unstable date:        Tue Oct 02 10:45:53 2007 +0100
---
 xen/common/sysctl.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff -r a86cf1d18625 -r c4f30c4a8540 xen/common/sysctl.c
--- a/xen/common/sysctl.c       Tue Oct 02 10:04:06 2007 +0100
+++ b/xen/common/sysctl.c       Tue Oct 02 10:47:32 2007 +0100
@@ -154,18 +154,13 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc
             if ( v->is_running )
                 cpuinfo.idletime += NOW() - v->runstate.state_entry_time;
 
+            ret = -EFAULT;
             if ( copy_to_guest_offset(op->u.getcpuinfo.info, i, &cpuinfo, 1) )
-            {
-                ret = -EFAULT;
-                break;
-            }
+                goto out;
         }
 
         op->u.getcpuinfo.nr_cpus = i;
-        ret = 0;
-
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
+        ret = copy_to_guest(u_sysctl, op, 1) ? -EFAULT : 0;
     }
     break;
 
@@ -174,6 +169,7 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc
         break;
     }
 
+ out:
     spin_unlock(&sysctl_lock);
 
     return ret;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.1-testing] Clean up and fix XEN_SYSCTL_getcpuinfo error path., Xen patchbot-3.1-testing <=