[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86/mm/p2m: don't leak state if nested-p2m init fails.



# HG changeset patch
# User Tim Deegan <tim@xxxxxxx>
# Date 1319121361 -3600
# Node ID 6c583d35d76dda2236c81d9437ff9d57ab02c006
# Parent  a06609840ff1335f1c36129881cfda4aaee7679b
x86/mm/p2m: don't leak state if nested-p2m init fails.

Signed-off-by: Tim Deegan <tim@xxxxxxx>
---


diff -r a06609840ff1 -r 6c583d35d76d xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Thu Oct 20 11:25:58 2011 +0100
+++ b/xen/arch/x86/mm/p2m.c     Thu Oct 20 15:36:01 2011 +0100
@@ -113,6 +113,7 @@
 int p2m_init(struct domain *d)
 {
     struct p2m_domain *p2m;
+    int rc;
 
     p2m_get_hostp2m(d) = p2m = xzalloc(struct p2m_domain);
     if ( p2m == NULL )
@@ -121,9 +122,11 @@
 
     /* Must initialise nestedp2m unconditionally
      * since nestedhvm_enabled(d) returns false here.
-     * (p2m_init runs too early for HVM_PARAM_* options)
-     */
-    return p2m_init_nestedp2m(d);
+     * (p2m_init runs too early for HVM_PARAM_* options) */
+    rc = p2m_init_nestedp2m(d);
+    if ( rc ) 
+        p2m_final_teardown(d);
+    return rc;
 }
 
 void p2m_change_entry_type_global(struct domain *d,

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.