swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 29 Oct 2013 00:37:37 +0000 (00:37 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 29 Oct 2013 00:37:37 +0000 (00:37 +0000)
map_sg returns the number of elements mapped, not a dma_addr_t.
In case of error return 0, not DMA_ERROR_CODE.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
drivers/xen/swiotlb-xen.c

index 100962dcc7bba24513051aca9950d4ff46694285..8af68629260bc9dce0287a61c21e706c8fada915 100644 (file)
@@ -548,7 +548,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
                                xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
                                                           attrs);
                                sg_dma_len(sgl) = 0;
-                               return DMA_ERROR_CODE;
+                               return 0;
                        }
                        sg->dma_address = xen_phys_to_bus(map);
                } else {