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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96cc55c8-16d1-7c2e-1a7c-2b73c5cfa267@amd.com>
Date:   Thu, 18 Jul 2019 21:50:32 +0000
From:   Gary R Hook <ghook@....com>
To:     Chuhong Yuan <hslester96@...il.com>
CC:     "Lendacky, Thomas" <Thomas.Lendacky@....com>,
        "Hook, Gary" <Gary.Hook@....com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>,
        "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] crypto: ccp - Replace dma_pool_alloc + memset with
 dma_pool_zalloc

On 7/18/19 8:16 AM, Chuhong Yuan wrote:
> Use dma_pool_zalloc instead of using dma_pool_alloc to allocate
> memory and then zeroing it with memset 0.
> This simplifies the code.
> 
> Signed-off-by: Chuhong Yuan <hslester96@...il.com>

Acked-by: Gary R Hook <gary.hook@....com>

> ---
>   drivers/crypto/ccp/ccp-ops.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
> index 866b2e05ca77..03797c42b336 100644
> --- a/drivers/crypto/ccp/ccp-ops.c
> +++ b/drivers/crypto/ccp/ccp-ops.c
> @@ -150,14 +150,13 @@ static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa,
>   	if (len <= CCP_DMAPOOL_MAX_SIZE) {
>   		wa->dma_pool = cmd_q->dma_pool;
>   
> -		wa->address = dma_pool_alloc(wa->dma_pool, GFP_KERNEL,
> +		wa->address = dma_pool_zalloc(wa->dma_pool, GFP_KERNEL,
>   					     &wa->dma.address);
>   		if (!wa->address)
>   			return -ENOMEM;
>   
>   		wa->dma.length = CCP_DMAPOOL_MAX_SIZE;
>   
> -		memset(wa->address, 0, CCP_DMAPOOL_MAX_SIZE);
>   	} else {
>   		wa->address = kzalloc(len, GFP_KERNEL);
>   		if (!wa->address)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ