mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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: be4000bc46 "hwrng: create filler thread"
Acked-by: Torsten Duwe <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
This commit is contained in:
1 parent
48d6be955a
commit
e02b876597
1 file changed
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user