From: Ian Campbell Date: Mon, 18 Oct 2010 15:53:04 +0000 (+0100) Subject: libxc: use correct size of struct xen_mc X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11395 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f5c808b428244f42b2310ddf173c624d9a2a842c;p=xen.git libxc: use correct size of struct xen_mc We want the size of the struct not the pointer (although rounding up to page size in lock_pages probably saves us). Signed-off-by: Ian Campbell Signed-off-by: Ian Jackson --- diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index a5f179a403..47acdb2fb8 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -153,7 +153,7 @@ int xc_mca_op(xc_interface *xch, struct xen_mc *mc) DECLARE_HYPERCALL; mc->interface_version = XEN_MCA_INTERFACE_VERSION; - if ( lock_pages(xch, mc, sizeof(mc)) ) + if ( lock_pages(xch, mc, sizeof(*mc)) ) { PERROR("Could not lock xen_mc memory"); return -EINVAL; @@ -162,7 +162,7 @@ int xc_mca_op(xc_interface *xch, struct xen_mc *mc) hypercall.op = __HYPERVISOR_mca; hypercall.arg[0] = (unsigned long)mc; ret = do_xen_hypercall(xch, &hypercall); - unlock_pages(xch, mc, sizeof(mc)); + unlock_pages(xch, mc, sizeof(*mc)); return ret; } #endif