Skip to content

Commit

Permalink
padata: Check for valid cpumasks
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
klassert authored and herbertx committed Jul 26, 2010
1 parent b89661d commit 7424713
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int padata_do_parallel(struct padata_instance *pinst,
pd = rcu_dereference(pinst->pd);

err = -EINVAL;
if (!(pinst->flags & PADATA_INIT))
if (!(pinst->flags & PADATA_INIT) || pinst->flags & PADATA_INVALID)
goto out;

if (!cpumask_test_cpu(cb_cpu, pd->cpumask.cbcpu))
Expand Down

0 comments on commit 7424713

Please sign in to comment.