Skip to contentSkip to conversation

swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs

PATCH New Stefano Stabellini 1 participant 1 message Oct 29, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs

map_sg returns the number of elements mapped, not a dma_addr_t. In case of error return 0, not DMA_ERROR_CODE.

---
 drivers/xen/swiotlb-xen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/xen/swiotlb-xen.c +1 -1
index 100962d..8af6862 100644
@@ -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 {
Signature · 1 line
1.7.2.5