Skip to content

Commit 2565030

Browse files
fxkamdalexdeucher
authored andcommitted
drm/amdgpu: Fix possible null pointer dereference
mem = bo->tbo.resource may be NULL in amdgpu_vm_bo_update. Fixes: 1802537 ("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 037b98a commit 2565030

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
10981098
bo = gem_to_amdgpu_bo(gobj);
10991099
}
11001100
mem = bo->tbo.resource;
1101-
if (mem->mem_type == TTM_PL_TT ||
1102-
mem->mem_type == AMDGPU_PL_PREEMPT)
1101+
if (mem && (mem->mem_type == TTM_PL_TT ||
1102+
mem->mem_type == AMDGPU_PL_PREEMPT))
11031103
pages_addr = bo->tbo.ttm->dma_address;
11041104
}
11051105

0 commit comments

Comments
 (0)