mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
crypto: caam - free resources in case caam_rng registration failed
[ Upstream commitc59a1d4167] Check the return value of the hardware registration for caam_rng and free resources in case of failure. Fixes:e24f7c9e87("crypto: caam - hwrng support") Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com> Reviewed-by: Horia Geanta <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
88f089d7f5
commit
e21a1c26c1
|
|
@ -353,7 +353,10 @@ static int __init caam_rng_init(void)
|
|||
goto free_rng_ctx;
|
||||
|
||||
dev_info(dev, "registering rng-caam\n");
|
||||
return hwrng_register(&caam_rng);
|
||||
|
||||
err = hwrng_register(&caam_rng);
|
||||
if (!err)
|
||||
return err;
|
||||
|
||||
free_rng_ctx:
|
||||
kfree(rng_ctx);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user