lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 11 Oct 2018 18:37:15 -0400
From:   Felix Kuehling <felix.kuehling@....com>
To:     zhong jiang <zhongjiang@...wei.com>, airlied@...ux.ie,
        alexander.deucher@....com
Cc:     christian.koenig@....com, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm: amd: Use kmemdup instead of duplicating its function

Hi Zhong Jiang,

Sorry for the late response. I just saw this while catching up with my
backlog after travelling end of September.

I applied your patch to amd-staging-drm-next. I only changed the
headline slightly to use the "drm/admkfd: " prefix that we commonly use
for KFD changes.

Regards,
  Felix


On 2018-09-18 11:35 AM, zhong jiang wrote:
> kmemdup has implemented the function that kmalloc() + memcpy().
> We prefer to kmemdup rather than code opened implementation.
>
> Signed-off-by: zhong jiang <zhongjiang@...wei.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> index ee49960..8ddd585 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> @@ -747,12 +747,10 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size)
>  		return -ENODATA;
>  	}
>  
> -	pcrat_image = kmalloc(crat_table->length, GFP_KERNEL);
> +	pcrat_image = kmemdup(crat_table, crat_table->length, GFP_KERNEL);
>  	if (!pcrat_image)
>  		return -ENOMEM;
>  
> -	memcpy(pcrat_image, crat_table, crat_table->length);
> -
>  	*crat_image = pcrat_image;
>  	*size = crat_table->length;
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ