RE: [PATCH] drm/amdgpu: fix error handling in amdgpu_bo_list_create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of
> Christian K?nig
> Sent: Thursday, September 19, 2019 1:43 AM
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Subject: [PATCH] drm/amdgpu: fix error handling in amdgpu_bo_list_create
> 
> We need to drop normal and userptr BOs separately.
> 
> Signed-off-by: Christian König <christian.koenig@xxxxxxx>

Acked-by: Huang Rui <ray.huang@xxxxxxx>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
> index d497467b7fc6..94908bf269a6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
> @@ -139,7 +139,12 @@ int amdgpu_bo_list_create(struct amdgpu_device
> *adev, struct drm_file *filp,
>  	return 0;
> 
>  error_free:
> -	while (i--) {
> +	for (i = 0; i < last_entry; ++i) {
> +		struct amdgpu_bo *bo = ttm_to_amdgpu_bo(array[i].tv.bo);
> +
> +		amdgpu_bo_unref(&bo);
> +	}
> +	for (i = first_userptr; i < num_entries; ++i) {
>  		struct amdgpu_bo *bo = ttm_to_amdgpu_bo(array[i].tv.bo);
> 
>  		amdgpu_bo_unref(&bo);
> --
> 2.17.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux