[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] passthrough: remove pointless error checks
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |