summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChristian König2019-02-07 11:41:59 +0100
committerAlex Deucher2019-02-07 20:03:18 +0100
commit7fbd31cceac0596c46394ea8745fe09b98d6ed79 (patch)
treeda3d3f0d3f211d64aabf5d5265335d9cc3c11bf7 /drivers/gpu/drm
parentdrm/amd/powerplay: add override pcie parameters for Vega20 (v2) (diff)
downloadkernel-qcow2-linux-7fbd31cceac0596c46394ea8745fe09b98d6ed79.tar.gz
kernel-qcow2-linux-7fbd31cceac0596c46394ea8745fe09b98d6ed79.tar.xz
kernel-qcow2-linux-7fbd31cceac0596c46394ea8745fe09b98d6ed79.zip
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/gpu/drm')
-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;