diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2010-07-20 02:51:25 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-07-26 02:13:58 -0400 |
commit | 7424713b83587006da72da84d7922471e366faba (patch) | |
tree | f6b8cf5db118494fc70be8f97309fd2434545223 /kernel | |
parent | b89661dff525a46edb7ee8a4423b5212068c05c0 (diff) |
padata: Check for valid cpumasks
Now that we allow to change the cpumasks from userspace, we have
to check for valid cpumasks in padata_do_parallel. This patch adds
the necessary check. This fixes a division by zero crash if the
parallel cpumask contains no active cpu.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/padata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/padata.c b/kernel/padata.c index 6a519454a5bd..7f895e2b4efb 100644 --- a/kernel/padata.c +++ b/kernel/padata.c | |||
@@ -114,7 +114,7 @@ int padata_do_parallel(struct padata_instance *pinst, | |||
114 | pd = rcu_dereference(pinst->pd); | 114 | pd = rcu_dereference(pinst->pd); |
115 | 115 | ||
116 | err = -EINVAL; | 116 | err = -EINVAL; |
117 | if (!(pinst->flags & PADATA_INIT)) | 117 | if (!(pinst->flags & PADATA_INIT) || pinst->flags & PADATA_INVALID) |
118 | goto out; | 118 | goto out; |
119 | 119 | ||
120 | if (!cpumask_test_cpu(cb_cpu, pd->cpumask.cbcpu)) | 120 | if (!cpumask_test_cpu(cb_cpu, pd->cpumask.cbcpu)) |