summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/core.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2014-12-08 16:50:39 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2014-12-22 23:02:40 +1100
commitebbbfa248389b176e2e62d8cf91814253849ccc9 (patch)
tree8f68d43898fc9bb1fccfdb931e4192f9553fd64b /drivers/char/hw_random/core.c
parenta027f30d72f2c4d27d6dd9bd053205d3102de7d1 (diff)
downloadlinux-stable-ebbbfa248389b176e2e62d8cf91814253849ccc9.tar.gz
linux-stable-ebbbfa248389b176e2e62d8cf91814253849ccc9.tar.bz2
linux-stable-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/hw_random/core.c')
-rw-r--r--drivers/char/hw_random/core.c5
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();