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

Huang Rui ray.huang at amd.com
Tue Sep 18 05:49:46 UTC 2018


On Mon, Sep 17, 2018 at 02:07:11PM -0400, Tom St Denis wrote:
> Signed-off-by: Tom St Denis <tom.stdenis at amd.com>

Reviewed-by: Huang Rui <ray.huang at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 84d82d5382f9..c1387efc0c91 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -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;
>  }
> -- 
> 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