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-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m: don't leak state if nested-p2m init fails.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 21 Oct 2011 01:33:09 +0100
Delivery-date: Thu, 20 Oct 2011 17:33:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86/mm/p2m: don't leak state if nested-p2m init fails., Xen patchbot-unstable <=