WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 05 of 24] libxc: use correct size of struct xen_mc

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 05 of 24] libxc: use correct size of struct xen_mc
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Mon, 06 Sep 2010 14:38:25 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 06 Sep 2010 06:44:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1283780300@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 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 <ian.campbell@xxxxxxxxxx>

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

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