From 88970bdcdbe0cdebf382e9538be5df35303fbe7d Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Wed, 15 Jun 2022 11:38:11 +0800 Subject: [PATCH] dma-buf: heaps: system_heap: fix to sg_dma_address The rknpu driver creates a sg without page link, so sg_phys(sg) will crash due to page null. Fixes: 33b98bf612bd ("dma-buf: system_heap: do force sync only if attachment list empty") Signed-off-by: Jianqun Xu Change-Id: I679122dd4c1663d0520429638565c6cc8b5a2c90 --- drivers/dma-buf/heaps/system_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 1130aa82969b..68eb78a4d6ea 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -239,7 +239,7 @@ static int system_heap_sgl_sync_range(struct device *dev, for_each_sg(sgl, sg, nents, i) { unsigned int sg_offset, sg_left, size = 0; - sg_dma_addr = sg_phys(sg); + sg_dma_addr = sg_dma_address(sg); len += sg->length; if (len <= offset)