diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2014-07-25 22:19:18 (GMT) |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-08-05 20:50:10 (GMT) |
commit | e02b876597777ab26288dd2611a97b597d14d661 (patch) | |
tree | 37bb8eb37e3d63932794f878a84d92dc8830e97f /drivers/char | |
parent | 48d6be955a7167b0d0e025ae6c39e795e3544499 (diff) | |
download | linux-e02b876597777ab26288dd2611a97b597d14d661.tar.xz |
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: be4000bc464 "hwrng: create filler thread"
Acked-by: Torsten Duwe <duwe@suse.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hw_random/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 349a3b8..33fd663 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -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; |