]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
random: Don't wake crng_init_wait when crng_init == 1
authorAndy Lutomirski <luto@kernel.org>
Mon, 23 Dec 2019 08:20:44 +0000 (00:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:48:58 +0000 (11:48 +0200)
commit 4c8d062186d9923c09488716b2fb1b829b5b8006 upstream.

crng_init_wait is only used to wayt for crng_init to be set to 2, so
there's no point to waking it when crng_init is set to 1.  Remove the
unnecessary wake_up_interruptible() call.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/6fbc0bfcbfc1fa2c76fd574f5b6f552b11be7fde.1577088521.git.luto@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c

index d818613051dcacbfa6322efda426d64f582d6c81..141523d0fbdd5ac6c8ed342040f72e24e523be8e 100644 (file)
@@ -965,7 +965,6 @@ static int crng_fast_load(const char *cp, size_t len)
        if (crng_init_cnt >= CRNG_INIT_CNT_THRESH) {
                invalidate_batched_entropy();
                crng_init = 1;
-               wake_up_interruptible(&crng_init_wait);
                pr_notice("random: fast init done\n");
        }
        return 1;