Skip to contentSkip to conversation

drm/amdgpu: fix NULL ptr dref in the VM code

PATCH In review Christian König 2 participants 2 messages Feb 7, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix NULL ptr dref in the VM code

The exclusive fence is of course perfectly optional here.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -3
index 5c935009091a..5d7c191044fc 100644
@@ -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;
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20190207104318.12944-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

Reviewed-by Felix Kuehling
#2 lore raw

________________________________________
From: amd-gfx <[email protected]> on behalf of Christian König <[email protected]>
Sent: Thursday, February 7, 2019 5:43 AM
To: [email protected]
Subject: [PATCH] drm/amdgpu: fix NULL ptr dref in the VM code

The exclusive fence is of course perfectly optional here.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -3
index 5c935009091a..5d7c191044fc 100644
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx