summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2019-02-07 11:41:59 +0100
committerAlex Deucher <alexander.deucher@amd.com>2019-02-07 14:03:18 -0500
commit7fbd31cceac0596c46394ea8745fe09b98d6ed79 (patch)
treeda3d3f0d3f211d64aabf5d5265335d9cc3c11bf7 /drivers
parent9d18c131ee67d005ffe7e9d2ac192b4218ba6476 (diff)
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 <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c8
1 files 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;