aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-05-21 16:19:54 +0800
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:05 +0200
commitff69231cd728b76d201ca685ccaf5a943de682cb (patch)
tree43d2ed6d80cb1b698f705b3deaa40e44c24cf432
parent280a1403ce402e90c40af2389af2a5c21d4bfdfd (diff)
random: Wake up all getrandom(2) callers when pool is ready
If more than one application invokes getrandom(2) before the pool is ready, then all bar one will be stuck forever because we use wake_up_interruptible which wakes up a single task. This patch replaces it with wake_up_all. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/char/random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 29db712b1..91ecb29b1 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -664,7 +664,7 @@ retry:
r->entropy_total = 0;
if (r == &nonblocking_pool) {
prandom_reseed_late();
- wake_up_interruptible(&urandom_init_wait);
+ wake_up_all(&urandom_init_wait);
pr_notice("random: %s pool is initialized\n", r->name);
}
}