Skip to content

Commit 91b646a

Browse files
matt-auldgregkh
authored andcommitted
drm/amdgpu/dma_buf: fix page_link check
commit c0dd8a9 upstream. The page_link lower bits of the first sg could contain something like SG_END, if we are mapping a single VRAM page or contiguous blob which fits into one sg entry. Rather pull out the struct page, and use that in our check to know if we mapped struct pages vs VRAM. Fixes: f44ffd6 ("drm/amdgpu: add support for exporting VRAM using DMA-buf v3") Signed-off-by: Matthew Auld <[email protected]> Cc: Christian König <[email protected]> Cc: [email protected] Cc: <[email protected]> # v5.8+ Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 228e98e commit 91b646a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static void amdgpu_dma_buf_unmap(struct dma_buf_attachment *attach,
181181
struct sg_table *sgt,
182182
enum dma_data_direction dir)
183183
{
184-
if (sgt->sgl->page_link) {
184+
if (sg_page(sgt->sgl)) {
185185
dma_unmap_sgtable(attach->dev, sgt, dir, 0);
186186
sg_free_table(sgt);
187187
kfree(sgt);

0 commit comments

Comments
 (0)