Skip to content

Commit a367b17

Browse files
klassertherbertx
authored andcommitted
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: Steffen Klassert <steffen.klassert@secunet.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 36f87a4 commit a367b17

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

crypto/ansi_cprng.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -408,17 +408,10 @@ static struct crypto_alg rng_alg = {
408408
/* Module initalization */
409409
static int __init prng_mod_init(void)
410410
{
411-
int ret = 0;
412-
413411
if (fips_enabled)
414412
rng_alg.cra_priority += 200;
415413

416-
ret = crypto_register_alg(&rng_alg);
417-
418-
if (ret)
419-
goto out;
420-
out:
421-
return 0;
414+
return crypto_register_alg(&rng_alg);
422415
}
423416

424417
static void __exit prng_mod_fini(void)

0 commit comments

Comments
 (0)