diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2010-03-04 00:30:22 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-03-04 00:30:22 -0500 |
commit | 74781387822cd7a549123ae2b35862bf802689be (patch) | |
tree | 3f6844cfbe3a58206e382b82a01c9300ae582c8a /kernel/padata.c | |
parent | 50beceba7fdf5f10a04d8a053e62d40b742099ad (diff) |
padata: Allocate the cpumask for the padata instance
The cpumask of the padata instance was used without allocated.
This caused boot crashes if CONFIG_CPUMASK_OFFSTACK is enabled.
This patch fixes this by doing proper allocation for this cpumask.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'kernel/padata.c')
-rw-r--r-- | kernel/padata.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/padata.c b/kernel/padata.c index 6f9bcb8313d6..93caf65ff57c 100644 --- a/kernel/padata.c +++ b/kernel/padata.c | |||
@@ -642,6 +642,9 @@ struct padata_instance *padata_alloc(const struct cpumask *cpumask, | |||
642 | if (!pd) | 642 | if (!pd) |
643 | goto err_free_inst; | 643 | goto err_free_inst; |
644 | 644 | ||
645 | if (!alloc_cpumask_var(&pinst->cpumask, GFP_KERNEL)) | ||
646 | goto err_free_pd; | ||
647 | |||
645 | rcu_assign_pointer(pinst->pd, pd); | 648 | rcu_assign_pointer(pinst->pd, pd); |
646 | 649 | ||
647 | pinst->wq = wq; | 650 | pinst->wq = wq; |
@@ -654,12 +657,14 @@ struct padata_instance *padata_alloc(const struct cpumask *cpumask, | |||
654 | pinst->cpu_notifier.priority = 0; | 657 | pinst->cpu_notifier.priority = 0; |
655 | err = register_hotcpu_notifier(&pinst->cpu_notifier); | 658 | err = register_hotcpu_notifier(&pinst->cpu_notifier); |
656 | if (err) | 659 | if (err) |
657 | goto err_free_pd; | 660 | goto err_free_cpumask; |
658 | 661 | ||
659 | mutex_init(&pinst->lock); | 662 | mutex_init(&pinst->lock); |
660 | 663 | ||
661 | return pinst; | 664 | return pinst; |
662 | 665 | ||
666 | err_free_cpumask: | ||
667 | free_cpumask_var(pinst->cpumask); | ||
663 | err_free_pd: | 668 | err_free_pd: |
664 | padata_free_pd(pd); | 669 | padata_free_pd(pd); |
665 | err_free_inst: | 670 | err_free_inst: |
@@ -685,6 +690,7 @@ void padata_free(struct padata_instance *pinst) | |||
685 | 690 | ||
686 | unregister_hotcpu_notifier(&pinst->cpu_notifier); | 691 | unregister_hotcpu_notifier(&pinst->cpu_notifier); |
687 | padata_free_pd(pinst->pd); | 692 | padata_free_pd(pinst->pd); |
693 | free_cpumask_var(pinst->cpumask); | ||
688 | kfree(pinst); | 694 | kfree(pinst); |
689 | } | 695 | } |
690 | EXPORT_SYMBOL(padata_free); | 696 | EXPORT_SYMBOL(padata_free); |