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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] passthrough: remove pointless error checks
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Sep 2009 02:00:20 -0700
Delivery-date: Tue, 15 Sep 2009 02:00:23 -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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1253002006 -3600
# Node ID d20260bece2d9da7a2a46936661fa9c8bf2c509c
# Parent  d2a32e24fe504b9626e6732b4f213c7cb1bc8b57
passthrough: remove pointless error checks

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>
---
 xen/drivers/passthrough/vtd/iommu.c           |    2 --
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    2 --
 2 files changed, 4 deletions(-)

diff -r d2a32e24fe50 -r d20260bece2d xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Wed Sep 09 16:39:41 2009 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Tue Sep 15 09:06:46 2009 +0100
@@ -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);
diff -r d2a32e24fe50 -r d20260bece2d 
xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h     Wed Sep 09 16:39:41 
2009 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h     Tue Sep 15 09:06:46 
2009 +0100
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] passthrough: remove pointless error checks, Xen patchbot-unstable <=