diff options
Diffstat (limited to 'kernel')
| -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); |
