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

[Xen-devel] [PATCH 04 of 18] libxc: use correct size of struct xen_mc



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1286892401 -3600
# Node ID 15c4f1cde006e6d8309eff86a99b609c4c1f090a
# Parent  a577eeeb43690b9df6be4789ced815e0c8e4cf13
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 <ian.campbell@xxxxxxxxxx>

diff -r a577eeeb4369 -r 15c4f1cde006 tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c     Tue Oct 12 15:06:41 2010 +0100
+++ b/tools/libxc/xc_misc.c     Tue Oct 12 15:06:41 2010 +0100
@@ -153,7 +153,7 @@ int xc_mca_op(xc_interface *xch, struct 
     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 
     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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.