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] VT-d minor edge case memory leak

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] VT-d minor edge case memory leak
From: "Ross Philipson" <Ross.Philipson@xxxxxxxxxx>
Date: Fri, 12 Sep 2008 15:28:56 -0400
Delivery-date: Fri, 12 Sep 2008 12:29:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20080912100948.GG19165%yamahata@xxxxxxxxxxxxx>
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: <20080912100948.GG19165%yamahata@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AckUv8Fws1aBE2JZT/CsudJmlNAD5gATaLDA
Thread-topic: [PATCH] VT-d minor edge case memory leak
Fixes an (unlikely) memory leak where mapped VT-d root entries are not
unmapped on allocation failure code path.

Signed-off-by: Ross Philipson <ross.philipson@xxxxxxxxxx>

diff -Nur a/xen/drivers/passthrough/vtd/iommu.c
b/xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       2008-09-12
08:40:15.000000000 -0400
+++ b/xen/drivers/passthrough/vtd/iommu.c       2008-09-12
15:13:36.000000000 -0400
@@ -152,6 +152,7 @@
         maddr = alloc_pgtable_maddr();
         if ( maddr == 0 )
         {
+            unmap_vtd_domain_page(root_entries);
             spin_unlock_irqrestore(&iommu->lock, flags);
             return 0;
         }


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