aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/platform_hypercall.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-12 08:42:30 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-12 08:42:30 +0100
commited562546ce8d129a7e708e2111b905a064a0b359 (patch)
tree7f973883eab63e1e7f8b422ef06446bb3bb09044 /xen/arch/x86/platform_hypercall.c
parentc021c95498d99be3700166bb01737130c32bbfd1 (diff)
downloadxen-ed562546ce8d129a7e708e2111b905a064a0b359.tar.gz
xen-ed562546ce8d129a7e708e2111b905a064a0b359.tar.bz2
xen-ed562546ce8d129a7e708e2111b905a064a0b359.zip
domctl: Fix cpumap/cpumask conversion functions to return an error code.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/platform_hypercall.c')
-rw-r--r--xen/arch/x86/platform_hypercall.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 26883b4d1c..81639e91f1 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -344,7 +344,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
guest_from_compat_handle(cpumap_bitmap,
op->u.getidletime.cpumap_bitmap);
ctlmap.bitmap.p = cpumap_bitmap.p; /* handle -> handle_64 conversion */
- xenctl_cpumap_to_cpumask(&cpumap, &ctlmap);
+ if ( (ret = xenctl_cpumap_to_cpumask(&cpumap, &ctlmap)) != 0 )
+ goto out;
guest_from_compat_handle(idletimes, op->u.getidletime.idletime);
for_each_cpu_mask ( cpu, cpumap )
@@ -359,7 +360,9 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
}
op->u.getidletime.now = now;
- cpumask_to_xenctl_cpumap(&ctlmap, &cpumap);
+ if ( (ret = cpumask_to_xenctl_cpumap(&ctlmap, &cpumap)) != 0 )
+ goto out;
+
ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
}
break;