aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-09-14 23:28:04 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2016-09-22 06:27:37 -0400
commit664f570a9cee51a8c7caef042118abd2b48705b1 (patch)
treeda37b8770fd9bcddc5e5783851811fcfdea11683 /drivers/crypto
parentc98ef8dbca18db133bb4bc7643b975ee2612be2f (diff)
crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset
Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset(). Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/ccp/ccp-dmaengine.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c
index ded26f46c735..2e5a05ce0e3e 100644
--- a/drivers/crypto/ccp/ccp-dmaengine.c
+++ b/drivers/crypto/ccp/ccp-dmaengine.c
@@ -299,12 +299,10 @@ static struct ccp_dma_desc *ccp_alloc_dma_desc(struct ccp_dma_chan *chan,
299{ 299{
300 struct ccp_dma_desc *desc; 300 struct ccp_dma_desc *desc;
301 301
302 desc = kmem_cache_alloc(chan->ccp->dma_desc_cache, GFP_NOWAIT); 302 desc = kmem_cache_zalloc(chan->ccp->dma_desc_cache, GFP_NOWAIT);
303 if (!desc) 303 if (!desc)
304 return NULL; 304 return NULL;
305 305
306 memset(desc, 0, sizeof(*desc));
307
308 dma_async_tx_descriptor_init(&desc->tx_desc, &chan->dma_chan); 306 dma_async_tx_descriptor_init(&desc->tx_desc, &chan->dma_chan);
309 desc->tx_desc.flags = flags; 307 desc->tx_desc.flags = flags;
310 desc->tx_desc.tx_submit = ccp_tx_submit; 308 desc->tx_desc.tx_submit = ccp_tx_submit;