Skip to content
Commit e64f57e8 authored by Tomas Marek's avatar Tomas Marek Committed by Herbert Xu
Browse files

hwrng: stm32 - fix read of the last word



The stm32_rng_read() function samples TRNG by 4 bytes until at
least 5 bytes are free in the input buffer. The last four bytes
are never read. For example, 60 bytes are returned in case the
input buffer size is 64 bytes.

Read until at least 4 bytes are free in the input buffer. Fill
the buffer entirely in case the buffer size is divisible by 4.

Cc: Oleg Karfich <oleg.karfich@wago.com>
Signed-off-by: default avatarTomas Marek <tomas.marek@elrest.cz>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 7e11a4fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment