X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Frandom32.c;h=ca87d86992bdb7bfd6bb30d4dbe6dcefe2bab7b9;hb=c907310fb0a5dd69a7fe11c08368abb0d34a35cb;hp=4a15ce51cea78f4843106221f3db13745b1eb4d7;hpb=cde49b058474ab3f7ff830283e5b538e8fbeefe5;p=pandora-kernel.git diff --git a/lib/random32.c b/lib/random32.c index 4a15ce51cea7..ca87d86992bd 100644 --- a/lib/random32.c +++ b/lib/random32.c @@ -36,6 +36,7 @@ #include #include #include +#include #include struct rnd_state { @@ -96,13 +97,18 @@ EXPORT_SYMBOL(random32); * @seed: seed value * * Add some additional seeding to the random32() pool. - * Note: this pool is per cpu so it only affects current CPU. */ void srandom32(u32 entropy) { - struct rnd_state *state = &get_cpu_var(net_rand_state); - __set_random32(state, state->s1 ^ entropy); - put_cpu_var(state); + int i; + /* + * No locking on the CPUs, but then somewhat random results are, well, + * expected. + */ + for_each_possible_cpu (i) { + struct rnd_state *state = &per_cpu(net_rand_state, i); + __set_random32(state, state->s1 ^ entropy); + } } EXPORT_SYMBOL(srandom32);