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>
This commit is contained in:
Christian König 2019-02-07 11:41:59 +01:00 committed by Alex Deucher
parent 9d18c131ee
commit 7fbd31ccea

View File

@ -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;