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>
Mon, 21 Feb 2022 20:14:21 +0000 (21:14 +0100)
commit1daf2f387652bf3a7044aea042f5023b3f6b189b
tree35d8540ac2074ccf368df90e0acc1db200e594b9
parentda792c6d5f59a76c10a310c5d4c93428fd18f996
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>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c