From 7fbd31cceac0596c46394ea8745fe09b98d6ed79 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Thu, 7 Feb 2019 11:41:59 +0100 Subject: [PATCH] drm/amdgpu: fix NULL ptr dref in the VM code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The exclusive fence is of course perfectly optional here. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 1e3a36c90d38..75481cf3348f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1789,9 +1789,11 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, return r; /* Wait for any BO move to be completed */ - r = dma_fence_wait(exclusive, true); - if (unlikely(r)) - return r; + if (exclusive) { + r = dma_fence_wait(exclusive, true); + if (unlikely(r)) + return r; + } params.func = amdgpu_vm_cpu_set_ptes; params.pages_addr = pages_addr; -- 2.39.5