Re: [PATCH 5/7] drm/amdgpu: don't allocate zero sized kernel BOs

2018-09-14 Thread Alex Deucher
On Fri, Sep 14, 2018 at 3:12 PM Christian König
 wrote:
>
> Just free the BO if the size is should be zero.
>
> Signed-off-by: Christian König 

Reviewed-by: Alex Deucher 

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index e1f32a196f6d..d282e923d1b4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -250,6 +250,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
> bool free = false;
> int r;
>
> +   if (!size) {
> +   amdgpu_bo_unref(bo_ptr);
> +   return 0;
> +   }
> +
> memset(, 0, sizeof(bp));
> bp.size = size;
> bp.byte_align = align;
> --
> 2.14.1
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 5/7] drm/amdgpu: don't allocate zero sized kernel BOs

2018-09-14 Thread Christian König
Just free the BO if the size is should be zero.

Signed-off-by: Christian König 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index e1f32a196f6d..d282e923d1b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -250,6 +250,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
bool free = false;
int r;
 
+   if (!size) {
+   amdgpu_bo_unref(bo_ptr);
+   return 0;
+   }
+
memset(, 0, sizeof(bp));
bp.size = size;
bp.byte_align = align;
-- 
2.14.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx