crypto: ansi_cprng - Fix module initialization
authorSteffen Klassert <steffen.klassert@secunet.com>
Sat, 29 Aug 2009 07:36:25 +0000 (17:36 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 29 Aug 2009 07:36:25 +0000 (17:36 +1000)
Return the value we got from crypto_register_alg() instead of
returning 0 in any case.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ansi_cprng.c

index 5357ba7d821a8149ca72d991ce346ca44f2ed8f4..3aa6e3834bfe8a133345145c591591260939106c 100644 (file)
@@ -408,17 +408,10 @@ static struct crypto_alg rng_alg = {
 /* Module initalization */
 static int __init prng_mod_init(void)
 {
-       int ret = 0;
-
        if (fips_enabled)
                rng_alg.cra_priority += 200;
 
-       ret = crypto_register_alg(&rng_alg);
-
-       if (ret)
-               goto out;
-out:
-       return 0;
+       return crypto_register_alg(&rng_alg);
 }
 
 static void __exit prng_mod_fini(void)