On 12/19/25 14:41, Tvrtko Ursulin wrote:
> The code will either fully populate the allocated array with userspace
> provided data, or abort and free the memory, so there is no need to clear
> the array before populating it.
> 
> Signed-off-by: Tvrtko Ursulin <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 -
>  1 file changed, 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 87ec46c56a6e..72c5096c3b18 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
> @@ -201,7 +201,6 @@ int amdgpu_bo_create_list_entry_array(struct 
> drm_amdgpu_bo_list_in *in,
>               if (!info)
>                       return -ENOMEM;
>  
> -             memset(info, 0, bo_number * info_size);
>               for (i = 0; i < bo_number; ++i, uptr += bo_info_size) {
>                       if (copy_from_user(&info[i], uptr, bytes)) {
>                               kvfree(info);

I think we should just nuke the complete else branch this code is part of.

The case when in->bo_info_size != sizeof(struct drm_amdgpu_bo_list_entry) was 
never used and most likely will never be used.

Regards,
Christian.

Reply via email to