]> git.baikalelectronics.ru Git - kernel.git/commit
init: call time_init() before rand_initialize()
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 5 May 2022 00:20:22 +0000 (02:20 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 13 May 2022 21:59:22 +0000 (23:59 +0200)
commitf841c3698acabf447a2653d5fdd6cdbae157715c
tree7d94c73a3012d87d6f8a07267cf17c6e2eb648fd
parent2177e7b163ff22c2b64345b5c0af5b5c286e2a80
init: call time_init() before rand_initialize()

Currently time_init() is called after rand_initialize(), but
rand_initialize() makes use of the timer on various platforms, and
sometimes this timer needs to be initialized by time_init() first. In
order for random_get_entropy() to not return zero during early boot when
it's potentially used as an entropy source, reverse the order of these
two calls. The block doing random initialization was right before
time_init() before, so changing the order shouldn't have any complicated
effects.

Cc: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
init/main.c