]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
crypto: caam - Clear some memory in instantiate_rng
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 21 Mar 2023 06:59:30 +0000 (07:59 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 31 Mar 2023 09:50:09 +0000 (17:50 +0800)
commit9c19fb86a8cb2ee82a832c95e139f29ea05c4d08
tree72affcbb98f7aeba77e59e16aa9a09d2694914b0
parent9117e682b8b79f7b5e2517fd28d42757d3e8b860
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.

Move the memset() to the beginning of the loop to be safe.

Fixes: 281922a1d4f5 ("crypto: caam - add support for SEC v5.x RNG4")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/ctrl.c