libxc: use correct size of struct xen_mc
authorIan Campbell <ian.campbell@citrix.com>
Mon, 18 Oct 2010 15:53:04 +0000 (16:53 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 18 Oct 2010 15:53:04 +0000 (16:53 +0100)
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 <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_misc.c

index a5f179a40334d7a5795ead3eba1d6daa3eb0b961..47acdb2fb8e5643d60feb2c1a4e7860aaa5bc75a 100644 (file)
@@ -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