Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: marvell/octeontx - Use kcalloc() instead of kzalloc()

Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Gustavo A. R. Silva and committed by
Herbert Xu
0b62b664 61a13714

+1 -3
+1 -3
drivers/crypto/marvell/octeontx/otx_cptvf_main.c
··· 94 94 u32 num_queues) 95 95 { 96 96 struct otx_cpt_pending_queue *queue = NULL; 97 - size_t size; 98 97 int ret; 99 98 u32 i; 100 99 101 100 pqinfo->num_queues = num_queues; 102 - size = (qlen * sizeof(struct otx_cpt_pending_entry)); 103 101 104 102 for_each_pending_queue(pqinfo, queue, i) { 105 - queue->head = kzalloc((size), GFP_KERNEL); 103 + queue->head = kcalloc(qlen, sizeof(*queue->head), GFP_KERNEL); 106 104 if (!queue->head) { 107 105 ret = -ENOMEM; 108 106 goto pending_qfail;