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: 33b98bf612 ("dma-buf: system_heap: do force sync only if attachment list empty")

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I679122dd4c1663d0520429638565c6cc8b5a2c90
This commit is contained in:
Jianqun Xu
2022-06-15 11:38:11 +08:00
committed by Tao Huang
parent a77b9747b5
commit 88970bdcdb

View File

@@ -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)