Skip to content

Commit

Permalink
hwrng: Pass entropy to add_hwgenerator_randomness() in bits, not bytes
Browse files Browse the repository at this point in the history
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: be4000b "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>
  • Loading branch information
Stephen Boyd authored and Theodore Ts'o committed Aug 5, 2014
1 parent 48d6be9 commit e02b876
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/hw_random/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e02b876

Please sign in to comment.