All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] crypto: marvell/octeontx - Use kcalloc() instead of kzalloc()
@ 2021-12-08  4:17 Gustavo A. R. Silva
  2021-12-08  5:24 ` Kees Cook
  2021-12-17  8:39 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2021-12-08  4:17 UTC (permalink / raw)
  To: Boris Brezillon, Arnaud Ebalard, Srujana Challa, Herbert Xu,
	David S. Miller
  Cc: linux-crypto, linux-kernel, Gustavo A. R. Silva, linux-hardening

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>
---
 drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
index c076d0b3ad5f..b681bd2dc6ad 100644
--- a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
+++ b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
@@ -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;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] crypto: marvell/octeontx - Use kcalloc() instead of kzalloc()
  2021-12-08  4:17 [PATCH][next] crypto: marvell/octeontx - Use kcalloc() instead of kzalloc() Gustavo A. R. Silva
@ 2021-12-08  5:24 ` Kees Cook
  2021-12-17  8:39 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2021-12-08  5:24 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Boris Brezillon, Arnaud Ebalard, Srujana Challa, Herbert Xu,
	David S. Miller, linux-crypto, linux-kernel, linux-hardening

On Tue, Dec 07, 2021 at 10:17:21PM -0600, Gustavo A. R. Silva wrote:
> 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>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] crypto: marvell/octeontx - Use kcalloc() instead of kzalloc()
  2021-12-08  4:17 [PATCH][next] crypto: marvell/octeontx - Use kcalloc() instead of kzalloc() Gustavo A. R. Silva
  2021-12-08  5:24 ` Kees Cook
@ 2021-12-17  8:39 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2021-12-17  8:39 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Boris Brezillon, Arnaud Ebalard, Srujana Challa, David S. Miller,
	linux-crypto, linux-kernel, linux-hardening

On Tue, Dec 07, 2021 at 10:17:21PM -0600, Gustavo A. R. Silva wrote:
> 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>
> ---
>  drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-17  8:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08  4:17 [PATCH][next] crypto: marvell/octeontx - Use kcalloc() instead of kzalloc() Gustavo A. R. Silva
2021-12-08  5:24 ` Kees Cook
2021-12-17  8:39 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.