drm/amdgpu: fix dropped backing store handling in amdgpu_dma_buf_move_notify
authorChristian König <ckoenig.leichtzumerken@gmail.com>
Fri, 10 Dec 2021 08:39:27 +0000 (09:39 +0100)
committerChristian König <christian.koenig@amd.com>
Fri, 17 Dec 2021 10:26:40 +0000 (11:26 +0100)
bo->tbo.resource can now be NULL.

Signed-off-by: Christian König <christian.koenig@amd.com>
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1811
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211210083927.1754-1-christian.koenig@amd.com
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c

index ae6ab93c868b8304a9540b6a0225de9d4d62ee72..7444484a12bf869dd8dddea2e62e7efc5e9a06ed 100644 (file)
@@ -384,7 +384,7 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
        struct amdgpu_vm_bo_base *bo_base;
        int r;
 
-       if (bo->tbo.resource->mem_type == TTM_PL_SYSTEM)
+       if (!bo->tbo.resource || bo->tbo.resource->mem_type == TTM_PL_SYSTEM)
                return;
 
        r = ttm_bo_validate(&bo->tbo, &placement, &ctx);