drm/amdgpu: fix NULL ptr dref in the VM code
authorChristian König <christian.koenig@amd.com>
Thu, 7 Feb 2019 10:41:59 +0000 (11:41 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Feb 2019 19:03:18 +0000 (14:03 -0500)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 1e3a36c..75481cf 100644 (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;