Skip to content

Commit 695c2c7

Browse files
Michel Dänzeralexdeucher
authored andcommitted
drm/amdgpu: Handle NULL bo->tbo.resource (again) in amdgpu_vm_bo_update
Third time's the charm, I hope? Fixes: d311675 ("drm/ttm: rename bo->mem and make it a pointer") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3837 Reviewed-by: Christian König <[email protected]> Signed-off-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent a21ab06 commit 695c2c7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,10 +1266,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
12661266
* next command submission.
12671267
*/
12681268
if (amdgpu_vm_is_bo_always_valid(vm, bo)) {
1269-
uint32_t mem_type = bo->tbo.resource->mem_type;
1270-
1271-
if (!(bo->preferred_domains &
1272-
amdgpu_mem_type_to_domain(mem_type)))
1269+
if (bo->tbo.resource &&
1270+
!(bo->preferred_domains &
1271+
amdgpu_mem_type_to_domain(bo->tbo.resource->mem_type)))
12731272
amdgpu_vm_bo_evicted(&bo_va->base);
12741273
else
12751274
amdgpu_vm_bo_idle(&bo_va->base);

0 commit comments

Comments
 (0)