提交 ebbbfa24 编写于 作者: R Rusty Russell 提交者: Herbert Xu

hwrng: don't double-check old_rng.

Interesting anti-pattern.
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 a027f30d
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册