Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59b8d4f1 authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

random: use for_each_online_node() to iterate over NUMA nodes



This fixes a crash on s390 with fake NUMA enabled.

Reported-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Fixes: 1e7f583a ("random: make /dev/urandom scalable for silly userspace programs")
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 86a574de
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1668,13 +1668,12 @@ static int rand_initialize(void)
#ifdef CONFIG_NUMA
	pool = kmalloc(num_nodes * sizeof(void *),
		       GFP_KERNEL|__GFP_NOFAIL|__GFP_ZERO);
	for (i=0; i < num_nodes; i++) {
	for_each_online_node(i) {
		crng = kmalloc_node(sizeof(struct crng_state),
				    GFP_KERNEL | __GFP_NOFAIL, i);
		spin_lock_init(&crng->lock);
		crng_initialize(crng);
		pool[i] = crng;

	}
	mb();
	crng_node_pool = pool;