random: only call crng_finalize_init() for primary_crng
authorDominik Brodowski <linux@dominikbrodowski.net>
Sun, 30 Jan 2022 21:03:20 +0000 (22:03 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 4 Feb 2022 18:22:32 +0000 (19:22 +0100)
commit9d5505f1eebeca778074a0260ed077fd85f8792c
tree1705c258ed5df7c8d10e07180af9c6623de63fd8
parentebf7606388732ecf2821ca21087e9446cb4a5b57
random: only call crng_finalize_init() for primary_crng

crng_finalize_init() returns instantly if it is called for another pool
than primary_crng. The test whether crng_finalize_init() is still required
can be moved to the relevant caller in crng_reseed(), and
crng_need_final_init can be reset to false if crng_finalize_init() is
called with workqueues ready. Then, no previous callsite will call
crng_finalize_init() unless it is needed, and we can get rid of the
superfluous function parameter.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c