From: Ian Campbell Subject: [PATCH 05 of 24] libxc: use correct size of struct xen_mc Date: Mon, 06 Sep 2010 14:38:25 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Ian Campbell # Date 1283779691 -3600 # Node ID b4aa42793b8a8434aa3d7371e22e86dcca4f5a7a # Parent 8ad75cd961a081ce4ba60c97899b13112d7a5f3f 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 diff -r 8ad75cd961a0 -r b4aa42793b8a tools/libxc/xc_misc.c --- a/tools/libxc/xc_misc.c Mon Sep 06 14:28:11 2010 +0100 +++ b/tools/libxc/xc_misc.c Mon Sep 06 14:28:11 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