aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/padata.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2013-08-23 07:12:33 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2013-08-29 00:37:59 -0400
commitb8b4a4166e3401b7d8ea9deb8d64d875a468144c (patch)
tree9c5456399972573e9fb6ff0cb05c0c717632f980 /kernel/padata.c
parent9c823f9f7e4b392921d0d8b251bec080d58f9077 (diff)
padata - Register hotcpu notifier after initialization
padata_cpu_callback() takes pinst->lock, to avoid taking an uninitialized lock, register the notifier after it's initialization. Signed-off-by: Richard Weinberger <richard@nod.at> Acked-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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/padata.c b/kernel/padata.c
index 2f0037a86289..07af2c95dcfe 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -1074,18 +1074,18 @@ struct padata_instance *padata_alloc(struct workqueue_struct *wq,
1074 1074
1075 pinst->flags = 0; 1075 pinst->flags = 0;
1076 1076
1077#ifdef CONFIG_HOTPLUG_CPU
1078 pinst->cpu_notifier.notifier_call = padata_cpu_callback;
1079 pinst->cpu_notifier.priority = 0;
1080 register_hotcpu_notifier(&pinst->cpu_notifier);
1081#endif
1082
1083 put_online_cpus(); 1077 put_online_cpus();
1084 1078
1085 BLOCKING_INIT_NOTIFIER_HEAD(&pinst->cpumask_change_notifier); 1079 BLOCKING_INIT_NOTIFIER_HEAD(&pinst->cpumask_change_notifier);
1086 kobject_init(&pinst->kobj, &padata_attr_type); 1080 kobject_init(&pinst->kobj, &padata_attr_type);
1087 mutex_init(&pinst->lock); 1081 mutex_init(&pinst->lock);
1088 1082
1083#ifdef CONFIG_HOTPLUG_CPU
1084 pinst->cpu_notifier.notifier_call = padata_cpu_callback;
1085 pinst->cpu_notifier.priority = 0;
1086 register_hotcpu_notifier(&pinst->cpu_notifier);
1087#endif
1088
1089 return pinst; 1089 return pinst;
1090 1090
1091err_free_masks: 1091err_free_masks: