xen/xenpaging.tools_xenpaging_cleanup.patch

59 lines
1.6 KiB
Diff
Raw Normal View History

Subject: xenpaging: Fix-up xenpaging tool code.
This isn't directly related to EPT checking, but does some general fix-ups
to the xenpaging code (adds some extra frees, etc.)
(xen-unstable changeset: 21890:3263d0ff9476)
Already-Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/xenpaging/xenpaging.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
Index: xen-4.0.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.0.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.0.2-testing/tools/xenpaging/xenpaging.c
@@ -101,7 +101,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;
}
@@ -199,13 +199,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;
}