Skip to content

Commit 7424713

Browse files
klassertherbertx
authored andcommitted
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>
1 parent b89661d commit 7424713

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/padata.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int padata_do_parallel(struct padata_instance *pinst,
114114
pd = rcu_dereference(pinst->pd);
115115

116116
err = -EINVAL;
117-
if (!(pinst->flags & PADATA_INIT))
117+
if (!(pinst->flags & PADATA_INIT) || pinst->flags & PADATA_INVALID)
118118
goto out;
119119

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

0 commit comments

Comments
 (0)