Commit 39a3b3c7 authored by Giancarlo Stasi's avatar Giancarlo Stasi Committed by Anas Nashif
Browse files

drivers: entropy: stm32: fix discarding of false negative rng values



Function random_byte_get() returns only the least significant byte of
the 32-bit random datum, as this is the used value, so avoiding that
higher numbers are interpreted as negative error codes and their value
is not discarded.

Signed-off-by: default avatarGiancarlo Stasi <giancarlo.stasi.co@gmail.com>
parent 41ca34a7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ static int random_byte_get(void)
		} else {
			retval = LL_RNG_ReadRandData32(
						    entropy_stm32_rng_data.rng);
			retval &= 0xFF;
		}
	}