This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 04 of 18] libxc: use correct size of struct xen_mc
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Tue, 12 Oct 2010 15:16:22 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Tue, 12 Oct 2010 07:22:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1286892978@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# 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 
     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;

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>