Commit a367b17f authored by Steffen Klassert's avatar Steffen Klassert Committed by Herbert Xu

crypto: ansi_cprng - Fix module initialization

Return the value we got from crypto_register_alg() instead of
returning 0 in any case.
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 36f87a4a
...@@ -408,17 +408,10 @@ static struct crypto_alg rng_alg = { ...@@ -408,17 +408,10 @@ static struct crypto_alg rng_alg = {
/* Module initalization */ /* Module initalization */
static int __init prng_mod_init(void) static int __init prng_mod_init(void)
{ {
int ret = 0;
if (fips_enabled) if (fips_enabled)
rng_alg.cra_priority += 200; rng_alg.cra_priority += 200;
ret = crypto_register_alg(&rng_alg); return crypto_register_alg(&rng_alg);
if (ret)
goto out;
out:
return 0;
} }
static void __exit prng_mod_fini(void) static void __exit prng_mod_fini(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment