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 01/18] xenpaging: Fix-up xenpaging tool code.

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 01/18] xenpaging: Fix-up xenpaging tool code.
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 15 Oct 2010 16:12:03 +0200
Delivery-date: Fri, 15 Oct 2010 07:13:24 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1287151929; l=1332; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=k5tdK5X5abo6MoSQmzNNnA3MGWM=; b=xPPjEsSiKyoDwRfZWhtOqoVkM04KWXHeglcSogoC5cy3RcSLUsO6AL8B5A5NklTNMrF HEx/gZtzl2v6zhk7Tj4nTiFHFtDIbIOXWua4x9oefYWPyuDtJ692q+Al/JDrgnSFAUax5 th2I7MS7rPC4tbhLugPTv5UQRzCcsPEEvwA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
References: <20101015141202.309585877@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.48-4.4
This isn't directly related to EPT checking, but does some general fix-ups
to the xenpaging code (adds some extra frees, etc.)

Already-Signed-off-by: Patrick Colp <pjcolp@xxxxxxxxx>
Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

---
 tools/xenpaging/xenpaging.c |   22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

--- xen-4.0.1-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.0.1-testing/tools/xenpaging/xenpaging.c
@@ -100,7 +100,7 @@ xenpaging_t *xenpaging_init(domid_t doma
     paging->mem_event.ring_page = init_page();
     if ( paging->mem_event.ring_page == NULL )
     {
-        ERROR("Error initialising shared page");
+        ERROR("Error initialising ring page");
         goto err;
     }
 
@@ -198,13 +198,27 @@ xenpaging_t *xenpaging_init(domid_t doma
     return paging;
 
  err:
-    if ( paging->bitmap )
+    if ( paging )
+    {
+        if ( paging->mem_event.shared_page )
+        {
+            munlock(paging->mem_event.shared_page, PAGE_SIZE);
+            free(paging->mem_event.shared_page);
+        }
+
+        if ( paging->mem_event.ring_page )
+        {
+            munlock(paging->mem_event.ring_page, PAGE_SIZE);
+            free(paging->mem_event.ring_page);
+        }
+
         free(paging->bitmap);
-    if ( paging->platform_info )
         free(paging->platform_info);
-    if ( paging )
+        free(paging->domain_info);
         free(paging);
+    }
 
+ err_iface:
     return NULL;
 }
 


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