diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-28 16:46:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-28 16:46:25 -0400 |
commit | 71e9dcc0019c8b1e7395d2d1512c08aa1c828710 (patch) | |
tree | 400fe7f8b4467d0551ba0aec4216fa11a38ef107 | |
parent | 6784725ab0b9473ce44bfad91a256bd72b5cddc1 (diff) | |
parent | 59b8d4f1f5d26e4ca92172ff6dcd1492cdb39613 (diff) |
Merge tag 'random_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random
Pull random driver fix from Ted Ts'o:
"Fix a boot failure on systems with non-contiguous NUMA id's"
* tag 'random_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random:
random: use for_each_online_node() to iterate over NUMA nodes
-rw-r--r-- | drivers/char/random.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 8d0af74f6569..7f0622426b97 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1668,13 +1668,12 @@ static int rand_initialize(void) | |||
1668 | #ifdef CONFIG_NUMA | 1668 | #ifdef CONFIG_NUMA |
1669 | pool = kmalloc(num_nodes * sizeof(void *), | 1669 | pool = kmalloc(num_nodes * sizeof(void *), |
1670 | GFP_KERNEL|__GFP_NOFAIL|__GFP_ZERO); | 1670 | GFP_KERNEL|__GFP_NOFAIL|__GFP_ZERO); |
1671 | for (i=0; i < num_nodes; i++) { | 1671 | for_each_online_node(i) { |
1672 | crng = kmalloc_node(sizeof(struct crng_state), | 1672 | crng = kmalloc_node(sizeof(struct crng_state), |
1673 | GFP_KERNEL | __GFP_NOFAIL, i); | 1673 | GFP_KERNEL | __GFP_NOFAIL, i); |
1674 | spin_lock_init(&crng->lock); | 1674 | spin_lock_init(&crng->lock); |
1675 | crng_initialize(crng); | 1675 | crng_initialize(crng); |
1676 | pool[i] = crng; | 1676 | pool[i] = crng; |
1677 | |||
1678 | } | 1677 | } |
1679 | mb(); | 1678 | mb(); |
1680 | crng_node_pool = pool; | 1679 | crng_node_pool = pool; |