diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2010-05-03 05:28:58 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-05-03 05:28:58 +0200 |
commit | df2071bd081408318d659cd14a9cf6ff23d874c9 (patch) | |
tree | b31291b5fd4b9f84c629833afbfaa8d431857475 /kernel/padata.c | |
parent | padata: Dont scale the parallel objects with the cpus (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6 (diff) | |
download | linux-df2071bd081408318d659cd14a9cf6ff23d874c9.tar.xz linux-df2071bd081408318d659cd14a9cf6ff23d874c9.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel/padata.c')
-rw-r--r-- | kernel/padata.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/padata.c b/kernel/padata.c index 5085046d83fb..5b44d0fa358e 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -25,6 +25,7 @@ #include <linux/padata.h> #include <linux/mutex.h> #include <linux/sched.h> +#include <linux/slab.h> #include <linux/rcupdate.h> #define MAX_SEQ_NR INT_MAX - NR_CPUS @@ -642,6 +643,9 @@ struct padata_instance *padata_alloc(const struct cpumask *cpumask, if (!pd) goto err_free_inst; + if (!alloc_cpumask_var(&pinst->cpumask, GFP_KERNEL)) + goto err_free_pd; + rcu_assign_pointer(pinst->pd, pd); pinst->wq = wq; @@ -654,12 +658,14 @@ struct padata_instance *padata_alloc(const struct cpumask *cpumask, pinst->cpu_notifier.priority = 0; err = register_hotcpu_notifier(&pinst->cpu_notifier); if (err) - goto err_free_pd; + goto err_free_cpumask; mutex_init(&pinst->lock); return pinst; +err_free_cpumask: + free_cpumask_var(pinst->cpumask); err_free_pd: padata_free_pd(pd); err_free_inst: @@ -685,6 +691,7 @@ void padata_free(struct padata_instance *pinst) unregister_hotcpu_notifier(&pinst->cpu_notifier); padata_free_pd(pinst->pd); + free_cpumask_var(pinst->cpumask); kfree(pinst); } EXPORT_SYMBOL(padata_free); |