Skip to contentSkip to conversation

drm/amd/amdgpu: Avoid fault when allocating an empty buffer object

PATCH In review Tom St Denis 3 participants 4 messages Sep 17, 2018 – Sep 18, 2018 2 messages not in the archive

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

PATCH 1/1 drm/amd/amdgpu: Avoid fault when allocating an empty buffer object

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
index 84d82d5382f9..c1387efc0c91 100644
@@ -348,7 +348,8 @@ int amdgpu_bo_create_kernel(struct amdgpu_device *adev,
 	if (r)
 		return r;
 
-	amdgpu_bo_unreserve(*bo_ptr);
+	if (*bo_ptr)
+		amdgpu_bo_unreserve(*bo_ptr);
 
 	return 0;
 }
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): [email protected]

Reviewed-by
#2 lore raw

Am 17.09.2018 um 20:07 schrieb Tom St Denis:

Quoted 1 line

You was faster than me :)

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -0
index 84d82d5382f9..c1387efc0c91 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c int amdgpu_bo_create_kernel(struct amdgpu_device *adev, · line 355

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
@@ -348,7 +348,8 @@ int amdgpu_bo_create_kernel(struct amdgpu_device *adev,
  	if (r)
  		return r;
 
-	amdgpu_bo_unreserve(*bo_ptr);
+	if (*bo_ptr)
+		amdgpu_bo_unreserve(*bo_ptr);
 
  	return 0;
  }

_______________________________________________
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): 9d13625d-f0da-cf16-2e0a-78db28dc7a1a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw
Quoted 6 lines · Christian König

Am 17.09.2018 um 20:07 schrieb Tom St Denis:

Quoted 1 line

You was faster than me :)

Been a while since I got a patch on the kernel side... need to keep up numbers :-)

Tom

Quoted 5 lines
Quoted 5 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-

  1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c int amdgpu_bo_create_kernel(struct amdgpu_device · line 354

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
index 84d82d5382f9..c1387efc0c91 100644
@@ -348,7 +348,8 @@ int amdgpu_bo_create_kernel(struct amdgpu_device 
 *adev,
       if (r)
           return r;
-    amdgpu_bo_unreserve(*bo_ptr);
+    if (*bo_ptr)
+        amdgpu_bo_unreserve(*bo_ptr);
       return 0;
   }

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

Reviewed-by
#5 lore raw
In reply to a message not in the archive
Quoted 1 line · Tom St Denis
Quoted 25 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -1
index 84d82d5382f9..c1387efc0c91 100644
@@ -348,7 +348,8 @@ int amdgpu_bo_create_kernel(struct amdgpu_device *adev,
 	if (r)
 		return r;
 
-	amdgpu_bo_unreserve(*bo_ptr);
+	if (*bo_ptr)
+		amdgpu_bo_unreserve(*bo_ptr);
 
 	return 0;
 }
Signature · 6 lines
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