Commit b8b4a4166e3401b7d8ea9deb8d64d875a468144c

Authored by Richard Weinberger
Committed by Herbert Xu
1 parent 9c823f9f7e

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>

Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff

... ... @@ -1074,17 +1074,17 @@
1074 1074  
1075 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 1077 put_online_cpus();
1084 1078  
1085 1079 BLOCKING_INIT_NOTIFIER_HEAD(&pinst->cpumask_change_notifier);
1086 1080 kobject_init(&pinst->kobj, &padata_attr_type);
1087 1081 mutex_init(&pinst->lock);
  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 1088  
1089 1089 return pinst;
1090 1090