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

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



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1191318353 -3600
# Node ID 8c67b2038ff2de2b7a75c1f81adb971931f54ceb
# Parent  a345f989722649ba01701babf60e49517e910102
Clean up and fix XEN_SYSCTL_getcpuinfo error path.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/sysctl.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff -r a345f9897226 -r 8c67b2038ff2 xen/common/sysctl.c
--- a/xen/common/sysctl.c       Tue Oct 02 10:01:10 2007 +0100
+++ b/xen/common/sysctl.c       Tue Oct 02 10:45:53 2007 +0100
@@ -177,18 +177,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;
 
@@ -209,6 +204,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®.