projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a027f30
)
hwrng: don't double-check old_rng.
author
Rusty Russell
<rusty@rustcorp.com.au>
Mon, 8 Dec 2014 08:50:39 +0000
(16:50 +0800)
committer
Herbert Xu
<herbert@gondor.apana.org.au>
Mon, 22 Dec 2014 12:02:40 +0000
(23:02 +1100)
Interesting anti-pattern.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/char/hw_random/core.c
b/drivers/char/hw_random/core.c
index 8d609a026465a73a2eb6fedf14727efba597df9a..e384ee3ed604d8733554db35f870a3239699e7ab 100644
(file)
--- 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();