mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
crypto: rng - Free default RNG on module exit
[ Upstream commit606ba888b9] When the rng module is removed the default RNG will be leaked. Call crypto_del_default_rng to free it if possible. Fixes:7cecadb7cc("crypto: rng - Do not free default RNG when it becomes unused") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fb4d57b833
commit
2ba2373151
@@ -226,5 +226,16 @@ void crypto_unregister_rngs(struct rng_alg *algs, int count)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(crypto_unregister_rngs);
|
||||
|
||||
static void __exit rng_exit(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = crypto_del_default_rng();
|
||||
if (err)
|
||||
pr_err("Failed delete default RNG: %d\n", err);
|
||||
}
|
||||
|
||||
module_exit(rng_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Random Number Generator");
|
||||
|
||||
Reference in New Issue
Block a user