From: Richard Weinberger Date: Fri, 23 Aug 2013 11:12:33 +0000 (+0200) Subject: padata - Register hotcpu notifier after initialization X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b8b4a4166e3401b7d8ea9deb8d64d875a468144c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Steffen Klassert Signed-off-by: Herbert Xu --- 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, pinst->flags = 0; -#ifdef CONFIG_HOTPLUG_CPU - pinst->cpu_notifier.notifier_call = padata_cpu_callback; - pinst->cpu_notifier.priority = 0; - register_hotcpu_notifier(&pinst->cpu_notifier); -#endif - put_online_cpus(); BLOCKING_INIT_NOTIFIER_HEAD(&pinst->cpumask_change_notifier); kobject_init(&pinst->kobj, &padata_attr_type); mutex_init(&pinst->lock); +#ifdef CONFIG_HOTPLUG_CPU + pinst->cpu_notifier.notifier_call = padata_cpu_callback; + pinst->cpu_notifier.priority = 0; + register_hotcpu_notifier(&pinst->cpu_notifier); +#endif + return pinst; err_free_masks: