random: check for crng_init == 0 in add_device_randomness()
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 12 Feb 2022 22:57:38 +0000 (23:57 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 16 Feb 2022 23:03:52 +0000 (00:03 +0100)
commita0c135b9c1387198792bb098ceed271e26170677
tree08c9584d30353d85fc76a0818635e6638cb336fc
parentcc538814458d90ef6225c4f84ed5165ef25b3f14
random: check for crng_init == 0 in add_device_randomness()

This has no real functional change, as crng_pre_init_inject() (and
before that, crng_slow_init()) always checks for == 0, not >= 2. So
correct the outer unlocked change to reflect that. Before this used
crng_ready(), which was not correct.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c