[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <16d6bf3bd7a6e96a8262fcd4680e3ccbb5a50478.1679355849.git.christophe.jaillet@wanadoo.fr>
Date: Tue, 21 Mar 2023 00:45:43 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: horia.geanta@....com, pankaj.gupta@....com, gaurav.jain@....com,
herbert@...dor.apana.org.au, davem@...emloft.net
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] crypto: caam: Clear some memory in instantiate_rng()
According to the comment at the end of the 'for' loop just a few lines
below, it looks needed to clear 'desc'.
So it should also be cleared for the first iteration.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
This patch is speculative, but can't hurt.
Maybe the memset() at the end of the 'for' loop could be removed instead.
---
drivers/crypto/caam/ctrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index 32253a064d0f..e4e971dc0f96 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -276,7 +276,7 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask,
int ret = 0, sh_idx;
ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl;
- desc = kmalloc(CAAM_CMD_SZ * 7, GFP_KERNEL | GFP_DMA);
+ desc = kzalloc(CAAM_CMD_SZ * 7, GFP_KERNEL | GFP_DMA);
if (!desc)
return -ENOMEM;
--
2.32.0
Powered by blists - more mailing lists