ia64/xen-unstable

changeset 16043:8c67b2038ff2

Clean up and fix XEN_SYSCTL_getcpuinfo error path.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Tue Oct 02 10:45:53 2007 +0100 (2007-10-02)
parents a345f9897226
children 50edcaff5520
files xen/common/sysctl.c
line diff
     1.1 --- a/xen/common/sysctl.c	Tue Oct 02 10:01:10 2007 +0100
     1.2 +++ b/xen/common/sysctl.c	Tue Oct 02 10:45:53 2007 +0100
     1.3 @@ -177,18 +177,13 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc
     1.4              if ( v->is_running )
     1.5                  cpuinfo.idletime += NOW() - v->runstate.state_entry_time;
     1.6  
     1.7 +            ret = -EFAULT;
     1.8              if ( copy_to_guest_offset(op->u.getcpuinfo.info, i, &cpuinfo, 1) )
     1.9 -            {
    1.10 -                ret = -EFAULT;
    1.11 -                break;
    1.12 -            }
    1.13 +                goto out;
    1.14          }
    1.15  
    1.16          op->u.getcpuinfo.nr_cpus = i;
    1.17 -        ret = 0;
    1.18 -
    1.19 -        if ( copy_to_guest(u_sysctl, op, 1) )
    1.20 -            ret = -EFAULT;
    1.21 +        ret = copy_to_guest(u_sysctl, op, 1) ? -EFAULT : 0;
    1.22      }
    1.23      break;
    1.24  
    1.25 @@ -209,6 +204,7 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc
    1.26          break;
    1.27      }
    1.28  
    1.29 + out:
    1.30      spin_unlock(&sysctl_lock);
    1.31  
    1.32      return ret;