From: FUJITA Tomonori Date: Wed, 17 Oct 2007 08:06:18 +0000 (+0200) Subject: swiotlb: fix map_sg failure handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9e91fdb32d449a6b57f8236a793ae2f3df79b4d8;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git swiotlb: fix map_sg failure handling sg list elements might not be continuous. Signed-off-by: FUJITA Tomonori Signed-off-by: Jens Axboe --- diff --git a/lib/swiotlb.c b/lib/swiotlb.c index c419ecf334c..752fd95323f 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -696,7 +696,7 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, /* Don't panic here, we expect map_sg users to do proper error handling. */ swiotlb_full(hwdev, sg->length, dir, 0); - swiotlb_unmap_sg(hwdev, sg - i, i, dir); + swiotlb_unmap_sg(hwdev, sgl, i, dir); sgl[0].dma_length = 0; return 0; }