diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2014-12-08 16:50:39 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-12-22 23:02:40 +1100 |
commit | ebbbfa248389b176e2e62d8cf91814253849ccc9 (patch) | |
tree | 8f68d43898fc9bb1fccfdb931e4192f9553fd64b /drivers/char | |
parent | a027f30d72f2c4d27d6dd9bd053205d3102de7d1 (diff) | |
download | blackbird-op-linux-ebbbfa248389b176e2e62d8cf91814253849ccc9.tar.gz blackbird-op-linux-ebbbfa248389b176e2e62d8cf91814253849ccc9.zip |
hwrng: don't double-check old_rng.
Interesting anti-pattern.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hw_random/core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 8d609a026465..e384ee3ed604 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -472,14 +472,13 @@ int hwrng_register(struct hwrng *rng) } old_rng = current_rng; + err = 0; if (!old_rng) { err = hwrng_init(rng); if (err) goto out_unlock; set_current_rng(rng); - } - err = 0; - if (!old_rng) { + err = register_miscdev(); if (err) { drop_current_rng(); |