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>
This commit is contained in:
Rusty Russell 2014-12-08 16:50:39 +08:00 committed by Herbert Xu
parent a027f30d72
commit ebbbfa2483
1 changed files with 2 additions and 3 deletions

View File

@ -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();