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] passthrough: remove pointless error checks

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] passthrough: remove pointless error checks
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Thu, 10 Sep 2009 15:08:46 +0100
Delivery-date: Thu, 10 Sep 2009 07:09:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
map_domain_page() cannot return NULL. And if it could, both instances
changed here would leak memory in such a case.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- 2009-09-10.orig/xen/drivers/passthrough/vtd/iommu.c 2009-09-09 
11:01:06.000000000 +0200
+++ 2009-09-10/xen/drivers/passthrough/vtd/iommu.c      2009-09-10 
15:24:11.000000000 +0200
@@ -156,8 +156,6 @@ u64 alloc_pgtable_maddr(struct acpi_drhd
     if ( !pg )
         return 0;
     vaddr = map_domain_page(page_to_mfn(pg));
-    if ( !vaddr )
-        return 0;
     memset(vaddr, 0, PAGE_SIZE * npages);
 
     iommu_flush_cache_page(vaddr, npages);
--- 2009-09-10.orig/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h       
2009-09-07 13:22:47.000000000 +0200
+++ 2009-09-10/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h    2009-09-10 
15:25:39.000000000 +0200
@@ -131,8 +131,6 @@ static inline struct page_info* alloc_am
     if ( pg == NULL )
         return 0;
     vaddr = map_domain_page(page_to_mfn(pg));
-    if ( vaddr == NULL )
-        return 0;
     memset(vaddr, 0, PAGE_SIZE);
     unmap_domain_page(vaddr);
     return pg;




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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] passthrough: remove pointless error checks, Jan Beulich <=