crypto: marvell/octeontx - Use kcalloc() instead of kzalloc()
Subsystems (2)
PATCH 1/1 crypto: marvell/octeontx - Use kcalloc() instead of kzalloc()
Use 2-factor multiplication argument form kcalloc() instead of kzalloc().
--- drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/crypto/marvell/octeontx/otx_cptvf_main.c +1 -3
@@ -94,15 +94,13 @@ static int alloc_pending_queues(struct otx_cpt_pending_qinfo *pqinfo, u32 qlen, u32 num_queues) {struct otx_cpt_pending_queue *queue =NULL ; -size_t size;int ret;u32 i; pqinfo->num_queues = num_queues; - size = (qlen *sizeof (struct otx_cpt_pending_entry ));for_each_pending_queue (pqinfo, queue, i) { - queue->head =kzalloc ((size),GFP_KERNEL ); + queue->head =kcalloc (qlen,sizeof (*queue->head),GFP_KERNEL );if (!queue->head) { ret = -ENOMEM ; goto pending_qfail;
Signature · 1 line
2.27.0
Quoted 5 lines · Gustavo A. R. Silva
Use 2-factor multiplication argument form
kcalloc()instead ofkzalloc().
Reviewed-by Kees Cook <[email protected]>
Signature · 1 line
Kees Cook
Herbert Xu
maintainerQuoted 8 lines · Gustavo A. R. Silva
Use 2-factor multiplication argument form
kcalloc()instead ofkzalloc().--- drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt