vtd: minor edge case memory leak
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 15 Sep 2008 10:35:20 +0000 (11:35 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 15 Sep 2008 10:35:20 +0000 (11:35 +0100)
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@citrix.com>
xen/drivers/passthrough/vtd/iommu.c

index 1a3757a2f4c77910c696e877f9e1964884944c79..c16d084776c5dbf811fe0142bbeab270c16f0ee0 100644 (file)
@@ -152,6 +152,7 @@ static u64 bus_to_context_maddr(struct iommu *iommu, u8 bus)
         maddr = alloc_pgtable_maddr();
         if ( maddr == 0 )
         {
+            unmap_vtd_domain_page(root_entries);
             spin_unlock_irqrestore(&iommu->lock, flags);
             return 0;
         }