[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.1-testing] Clean up and fix XEN_SYSCTL_getcpuinfo error path.



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.