Commit 9e91fdb3 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Jens Axboe

swiotlb: fix map_sg failure handling

sg list elements might not be continuous.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 24c31eed
...@@ -696,7 +696,7 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, ...@@ -696,7 +696,7 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sgl, int nelems,
/* Don't panic here, we expect map_sg users /* Don't panic here, we expect map_sg users
to do proper error handling. */ to do proper error handling. */
swiotlb_full(hwdev, sg->length, dir, 0); 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; sgl[0].dma_length = 0;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment