]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:29:03 +0000 (09:29 +0200)
commitae3d1425e9256925745bae06f157b02c6054f908
treedc345d9b6727a2963cd8b2265dd11bce4a8bc5c9
parentf05ca103ec2798dd579d16abcf6f0c05f43cbcf0
random: only call crng_finalize_init() for primary_crng

commit a3fb1940b584ca44e6a9729ded3e68704ef0db61 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c