[PATCH] drm/amdgpu: fix NULL ptr dref in the VM code
Kuehling, Felix
Felix.Kuehling at amd.com
Thu Feb 7 14:00:46 UTC 2019
Reviewed-by: Felix Kuehling <Felix.Kuehling at amd.com>
________________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken at gmail.com>
Sent: Thursday, February 7, 2019 5:43 AM
To: amd-gfx at lists.freedesktop.org
Subject: [PATCH] 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 at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 +++++---
1 file 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 5c935009091a..5d7c191044fc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1787,9 +1787,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;
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list