[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] linux/x86: dma_map_dg(): BUG_ON() before use



As usual, written and tested against 2.6.24-rc3 and made apply against
2.6.18 without further testing.

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

Index: head-2007-11-30/arch/i386/kernel/pci-dma-xen.c
===================================================================
--- head-2007-11-30.orig/arch/i386/kernel/pci-dma-xen.c 2007-12-04 
14:52:27.000000000 +0100
+++ head-2007-11-30/arch/i386/kernel/pci-dma-xen.c      2007-12-04 
14:54:28.000000000 +0100
@@ -92,10 +92,10 @@ dma_map_sg(struct device *hwdev, struct 
                rc = swiotlb_map_sg(hwdev, sg, nents, direction);
        } else {
                for (i = 0; i < nents; i++ ) {
+                       BUG_ON(!sg[i].page);
                        sg[i].dma_address =
                                gnttab_dma_map_page(sg[i].page) + sg[i].offset;
                        sg[i].dma_length  = sg[i].length;
-                       BUG_ON(!sg[i].page);
                        IOMMU_BUG_ON(address_needs_mapping(
                                hwdev, sg[i].dma_address));
                        IOMMU_BUG_ON(range_straddles_page_boundary(




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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.