[Public]

Acked-by: Alex Deucher <alexander.deuc...@amd.com>
________________________________
From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> on behalf of Christian 
König <ckoenig.leichtzumer...@gmail.com>
Sent: Friday, December 10, 2021 3:39 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; 
alexdeuc...@gmail.com <alexdeuc...@gmail.com>
Subject: [PATCH] drm/amdgpu: fix dropped backing store handling in 
amdgpu_dma_buf_move_notify

bo->tbo.resource can now be NULL.

Signed-off-by: Christian König <christian.koe...@amd.com>
Bug: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1811&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C8ece16670f1b44091a4308d9bbb897e5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637747223768954678%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=N4gltO0T3wozmHbROWRr3RiWFWXNu522ghTewe8T3bA%3D&amp;reserved=0
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
index ae6ab93c868b..7444484a12bf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
@@ -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);
--
2.25.1

Reply via email to