summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/padata.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/padata.c b/kernel/padata.c
index 57ec4eb5f2e3..ae8defcf0622 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -111,10 +111,13 @@ int padata_do_parallel(struct padata_instance *pinst,
pd = rcu_dereference(pinst->pd);
- err = 0;
+ err = -EINVAL;
if (!(pinst->flags & PADATA_INIT))
goto out;
+ if (!cpumask_test_cpu(cb_cpu, pd->cpumask))
+ goto out;
+
err = -EBUSY;
if ((pinst->flags & PADATA_RESET))
goto out;
@@ -122,11 +125,7 @@ int padata_do_parallel(struct padata_instance *pinst,
if (atomic_read(&pd->refcnt) >= MAX_OBJ_NUM)
goto out;
- err = -EINVAL;
- if (!cpumask_test_cpu(cb_cpu, pd->cpumask))
- goto out;
-
- err = -EINPROGRESS;
+ err = 0;
atomic_inc(&pd->refcnt);
padata->pd = pd;
padata->cb_cpu = cb_cpu;