From: Christian König Date: Thu, 7 Feb 2019 10:41:59 +0000 (+0100) Subject: drm/amdgpu: fix NULL ptr dref in the VM code X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7fbd31cceac0596c46394ea8745fe09b98d6ed79;p=linux.git drm/amdgpu: fix NULL ptr dref in the VM code The exclusive fence is of course perfectly optional here. Signed-off-by: Christian König Reviewed-by: Felix Kuehling 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 1e3a36c90d38c..75481cf3348f7 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;