]> git.baikalelectronics.ru Git - kernel.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:20 +0000 (23:03 +0900)
commit8afdd32e1aa32c81a75f3e009cf124a946affed8
treecf761a2880dafe26318b44cc27ee44d8228c1845
parent06960f2583e49f170f322d5a1f7afd5aa8571b87
crypto: caam - Clear some memory in instantiate_rng

[ Upstream commit 9c19fb86a8cb2ee82a832c95e139f29ea05c4d08 ]

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: 19db7df8205e ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/caam/ctrl.c