提交 e02b8765 编写于 作者: S Stephen Boyd 提交者: Theodore Ts'o

hwrng: Pass entropy to add_hwgenerator_randomness() in bits, not bytes

rng_get_data() returns the number of bytes read from the hardware.
The entropy argument to add_hwgenerator_randomness() is passed
directly to credit_entropy_bits() so we should be passing the
number of bits, not bytes here.

Fixes: be4000bc "hwrng: create filler thread"
Acked-by: NTorsten Duwe <duwe@suse.de>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
上级 48d6be95
......@@ -342,7 +342,7 @@ static int hwrng_fillfn(void *unused)
continue;
}
add_hwgenerator_randomness((void *)rng_fillbuf, rc,
(rc*current_quality)>>10);
rc * current_quality * 8 >> 10);
}
hwrng_fill = NULL;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册