]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdgpu/dma_buf: fix page_link check
authorMatthew Auld <matthew.auld@intel.com>
Mon, 7 Apr 2025 14:18:25 +0000 (15:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:48:00 +0000 (10:48 +0200)
commit91b646a0b2cbd1d6d1b0be49ae780b6d2ea6011c
tree1b06410af8b4da73ba8021517871bbb442e3661b
parent228e98e2021cef1b4f5f0d8614b4371e05d9098d
drm/amdgpu/dma_buf: fix page_link check

commit c0dd8a9253fadfb8e5357217d085f1989da4ef0a 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: f44ffd677fb3 ("drm/amdgpu: add support for exporting VRAM using DMA-buf v3")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v5.8+
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c