Am 07.11.23 um 17:58 schrieb Felix Kuehling:
mem = bo->tbo.resource may be NULL in amdgpu_vm_bo_update.

Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO 
creation")
Signed-off-by: Felix Kuehling <felix.kuehl...@amd.com>

Reviewed-by: Christian König <christian.koe...@amd.com>

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 7b2a7c9156f0..1442d97ddd0f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1015,8 +1015,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, 
struct amdgpu_bo_va *bo_va,
                                bo = gem_to_amdgpu_bo(gobj);
                }
                mem = bo->tbo.resource;
-               if (mem->mem_type == TTM_PL_TT ||
-                   mem->mem_type == AMDGPU_PL_PREEMPT)
+               if (mem && (mem->mem_type == TTM_PL_TT ||
+                           mem->mem_type == AMDGPU_PL_PREEMPT))
                        pages_addr = bo->tbo.ttm->dma_address;
        }

Reply via email to