[PATCH] drm/amdgpu: fix dropped backing store handling in amdgpu_dma_buf_move_notify

Deucher, Alexander Alexander.Deucher at amd.com
Fri Dec 10 14:06:45 UTC 2021


[Public]

Acked-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken at gmail.com>
Sent: Friday, December 10, 2021 3:39 AM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>; alexdeucher at gmail.com <alexdeucher at 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.koenig at amd.com>
Bug: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1811&data=04%7C01%7Calexander.deucher%40amd.com%7C8ece16670f1b44091a4308d9bbb897e5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637747223768954678%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=N4gltO0T3wozmHbROWRr3RiWFWXNu522ghTewe8T3bA%3D&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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20211210/ec87326a/attachment-0001.htm>


More information about the amd-gfx mailing list