projects
/
platform
/
kernel
/
linux-rpi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
initramfs: break loop when decompression finishes
[platform/kernel/linux-rpi.git]
/
kernel
/
padata.c
diff --git
a/kernel/padata.c
b/kernel/padata.c
index
222d601
..
179fb15
100644
(file)
--- a/
kernel/padata.c
+++ b/
kernel/padata.c
@@
-202,7
+202,7
@@
int padata_do_parallel(struct padata_shell *ps,
*cb_cpu = cpu;
}
*cb_cpu = cpu;
}
- err =
-EBUSY;
+ err = -EBUSY;
if ((pinst->flags & PADATA_RESET))
goto out;
if ((pinst->flags & PADATA_RESET))
goto out;
@@
-1102,12
+1102,16
@@
EXPORT_SYMBOL(padata_alloc_shell);
*/
void padata_free_shell(struct padata_shell *ps)
{
*/
void padata_free_shell(struct padata_shell *ps)
{
+ struct parallel_data *pd;
+
if (!ps)
return;
mutex_lock(&ps->pinst->lock);
list_del(&ps->list);
if (!ps)
return;
mutex_lock(&ps->pinst->lock);
list_del(&ps->list);
- padata_free_pd(rcu_dereference_protected(ps->pd, 1));
+ pd = rcu_dereference_protected(ps->pd, 1);
+ if (refcount_dec_and_test(&pd->refcnt))
+ padata_free_pd(pd);
mutex_unlock(&ps->pinst->lock);
kfree(ps);
mutex_unlock(&ps->pinst->lock);
kfree(ps);