xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] VT-d: fix two map_domain_page() leaks
@ 2010-12-16 15:38 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2010-12-16 15:38 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com; +Cc: ZhouPeng

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Tested-by: ZhouPeng <zpengxen@gmail.com>

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1331,6 +1331,7 @@ int domain_context_mapping_one(
     if ( context_set_domain_id(context, domain, iommu) )
     {
         spin_unlock(&iommu->lock);
+        unmap_vtd_domain_page(context_entries);
         return -EFAULT;
     }
 
@@ -1672,6 +1673,7 @@ static int intel_iommu_map_page(
     if ( old.val == new.val )
     {
         spin_unlock(&hd->mapping_lock);
+        unmap_vtd_domain_page(page);
         return 0;
     }
     *pte = new;




[-- Attachment #2: vtd-map-page-leak.patch --]
[-- Type: text/plain, Size: 649 bytes --]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Tested-by: ZhouPeng <zpengxen@gmail.com>

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1331,6 +1331,7 @@ int domain_context_mapping_one(
     if ( context_set_domain_id(context, domain, iommu) )
     {
         spin_unlock(&iommu->lock);
+        unmap_vtd_domain_page(context_entries);
         return -EFAULT;
     }
 
@@ -1672,6 +1673,7 @@ static int intel_iommu_map_page(
     if ( old.val == new.val )
     {
         spin_unlock(&hd->mapping_lock);
+        unmap_vtd_domain_page(page);
         return 0;
     }
     *pte = new;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-16 15:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16 15:38 [PATCH] VT-d: fix two map_domain_page() leaks Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).