WSL2-Linux-Kernel/drivers/dma-buf
Guangming 679d94cd7d dma-buf: system_heap: Use 'for_each_sgtable_sg' in pages free flow
For previous version, it uses 'sg_table.nent's to traverse sg_table in pages
free flow.
However, 'sg_table.nents' is reassigned in 'dma_map_sg', it means the number of
created entries in the DMA adderess space.
So, use 'sg_table.nents' in pages free flow will case some pages can't be freed.

Here we should use sg_table.orig_nents to free pages memory, but use the
sgtable helper 'for each_sgtable_sg'(, instead of the previous rather common
helper 'for_each_sg' which maybe cause memory leak) is much better.

Fixes: d963ab0f15 ("dma-buf: system_heap: Allocate higher order pages if available")
Signed-off-by: Guangming <Guangming.Cao@mediatek.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Cc: <stable@vger.kernel.org> # 5.11.*
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211126074904.88388-1-guangming.cao@mediatek.com
2021-12-01 15:30:10 +05:30
..
heaps dma-buf: system_heap: Use 'for_each_sgtable_sg' in pages free flow 2021-12-01 15:30:10 +05:30
Kconfig dma-buf: DMABUF_SYSFS_STATS should depend on DMA_SHARED_BUFFER 2021-09-07 12:42:21 +05:30
Makefile
dma-buf-sysfs-stats.c
dma-buf-sysfs-stats.h
dma-buf.c drm next/fixes for 5.16-rc1 2021-11-12 12:11:07 -08:00
dma-fence-array.c
dma-fence-chain.c
dma-fence.c dma-buf: clarify dma_fence_add_callback documentation 2021-09-03 10:12:12 +02:00
dma-heap.c
dma-resv.c dma-resv: Fix dma_resv_get_fences and dma_resv_copy_fences after conversion 2021-10-11 16:14:08 +02:00
selftest.c
selftest.h
selftests.h
st-dma-fence-chain.c
st-dma-fence.c
sw_sync.c
sync_debug.c
sync_debug.h
sync_file.c
sync_trace.h
udmabuf.c