]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge tag 'random_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Jul 2016 20:46:25 +0000 (13:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Jul 2016 20:46:25 +0000 (13:46 -0700)
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

drivers/char/random.c

index 8d0af74f656987f2d1be560e336962e2d7badf20..7f0622426b972fcaf4fb82b818f1079f7216e853 100644 (file)
@@ -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;