Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e02b8765 authored by Stephen Boyd's avatar Stephen Boyd Committed by Theodore Ts'o
Browse files

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: default avatarTorsten Duwe <duwe@suse.de>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 48d6be95
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;