Skip to content

Commit

Permalink
swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefano Stabellini committed Oct 29, 2013
1 parent 6b42a7e commit 1517760
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/xen/swiotlb-xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1517760

Please sign in to comment.