The fence parameter is only optional.

Signed-off-by: Christian König <christian.koe...@amd.com>
Fixes: 86fd5edfbdae ("drm/amdgpu: rework TLB flushing")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index c29b12fec863..48f326609976 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -929,9 +929,10 @@ int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 
        if (!unlocked && (!(flags & AMDGPU_PTE_VALID) || params.table_freed)) {
                tlb_cb->vm = vm;
-               if (!*fence || dma_fence_add_callback(*fence, &tlb_cb->cb,
-                                                     amdgpu_vm_tlb_seq_cb))
-                       amdgpu_vm_tlb_seq_cb(*fence, &tlb_cb->cb);
+               if (!fence || !*fence ||
+                   dma_fence_add_callback(*fence, &tlb_cb->cb,
+                                          amdgpu_vm_tlb_seq_cb))
+                       amdgpu_vm_tlb_seq_cb(NULL, &tlb_cb->cb);
                tlb_cb = NULL;
        }
 
-- 
2.25.1

Reply via email to