Re: [PATCH 01/14] drm/amdgpu: handle bo size 0 in amdgpu_bo_create_kernel_at

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

 



Am 2020-07-28 um 6:45 p.m. schrieb Alex Deucher:
> Just return early to match other bo_create functions.
>
> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
> ---
>  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 5ac7b5561475..16a37caa654a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -366,6 +366,11 @@ int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev,
>  	unsigned int i;
>  	int r;
>  
> +	if (!size) {
> +		amdgpu_bo_unref(bo_ptr);

I was going to say, unreffing the bo_ptr before allocating anything
seems weird. But amdgpu_bo_create_reserved, which is called just below,
does the same thing. So this doesn't really change anything. Never mind.

Regards,
  Felix


> +		return 0;
> +	}
> +
>  	offset &= PAGE_MASK;
>  	size = ALIGN(size, PAGE_SIZE);
>  
_______________________________________________
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