Skip to content

Commit bd050bb

Browse files
Michel Dänzergregkh
authored andcommitted
drm/amdgpu: Handle NULL bo->tbo.resource (again) in amdgpu_vm_bo_update
commit 85230ee36d88e7a09fb062d43203035659dd10a5 upstream. 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]> (cherry picked from commit 695c2c745e5dff201b75da8a1d237ce403600d04) Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 71a7e2f commit bd050bb

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
@@ -1060,10 +1060,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
10601060
* next command submission.
10611061
*/
10621062
if (bo && bo->tbo.base.resv == vm->root.bo->tbo.base.resv) {
1063-
uint32_t mem_type = bo->tbo.resource->mem_type;
1064-
1065-
if (!(bo->preferred_domains &
1066-
amdgpu_mem_type_to_domain(mem_type)))
1063+
if (bo->tbo.resource &&
1064+
!(bo->preferred_domains &
1065+
amdgpu_mem_type_to_domain(bo->tbo.resource->mem_type)))
10671066
amdgpu_vm_bo_evicted(&bo_va->base);
10681067
else
10691068
amdgpu_vm_bo_idle(&bo_va->base);

0 commit comments

Comments
 (0)