Skip to contentSkip to conversation

crypto: ansi_cprng - Fix module initialization

PATCH In review Steffen Klassert 3 participants 3 messages Aug 25, 2009 – Aug 29, 2009 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: ansi_cprng - Fix module initialization

Return the value we got from crypto_register_alg() instead of returning 0 in any case.

---
 crypto/ansi_cprng.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
crypto/ansi_cprng.c +0 -3
index 5357ba7..3aa6e38 100644
@@ -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);
Acked-by on v1 1/1
#1 lore raw
Quoted 35 lines · Steffen Klassert

Return the value we got from crypto_register_alg() instead of returning 0 in any case.

---
 crypto/ansi_cprng.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
crypto/ansi_cprng.c +1 -8
index 5357ba7..3aa6e38 100644
@@ -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)
Signature · 1 line
1.5.4.2

Thanks!

maintainer
#2 lore raw
Quoted 7 lines · Neil Horman
Quoted 4 lines · Steffen Klassert

Return the value we got from crypto_register_alg() instead of returning 0 in any case.

Patch applied. Thanks a lot!

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt