]> git.proxmox.com Git - mirror_spl.git/commit
Fix out-of-bound in per_cpu in spl_random_init
authortuxoko <tuxoko@gmail.com>
Sat, 8 Oct 2016 03:59:46 +0000 (20:59 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 8 Oct 2016 03:59:46 +0000 (20:59 -0700)
commit0d267566650d89bde8bd5ec4665749810d5bafc7
tree9938ec689e4de3209b2d2d2d257a311832aecbb7
parent2529b3a80e1bf1713c0ecbedb246654a0968b4d2
Fix out-of-bound in per_cpu in spl_random_init

When iterating per_cpu values, we need to use for_each_possible_cpu. While
NR_CPUS indicates the number of CPU supported by the kernel, it might not
initialize all of them if the kernel decides it's not possible to use them.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #578
module/spl/spl-generic.c