From: Christian König Date: Wed, 24 Oct 2018 14:25:23 +0000 (+0200) Subject: drm/amdgpu: fix VM leaf walking X-Git-Tag: v5.4-rc1~2273^2~1^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4faaaa762328cfb8579b9c908999ca189e2ea474;p=platform%2Fkernel%2Flinux-rpi.git drm/amdgpu: fix VM leaf walking Make sure we don't try to go down further after the leave walk already ended. This fixes a crash with a new VM test. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Acked-by: Alex Deucher Tested-by: Rex Zhu Rex.Zhu@amd.com Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index db0cbf8..352b304 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -542,7 +542,8 @@ static void amdgpu_vm_pt_next_leaf(struct amdgpu_device *adev, struct amdgpu_vm_pt_cursor *cursor) { amdgpu_vm_pt_next(adev, cursor); - while (amdgpu_vm_pt_descendant(adev, cursor)); + if (cursor->pfn != ~0ll) + while (amdgpu_vm_pt_descendant(adev, cursor)); } /**