public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel/padata.c: Register hotcpu notifier after initialization
@ 2013-08-23 11:12 Richard Weinberger
  2013-08-27  9:30 ` Steffen Klassert
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2013-08-23 11:12 UTC (permalink / raw)
  To: steffen.klassert
  Cc: linux-crypto, linux-kernel, herbert, gang.chen,
	Richard Weinberger

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>
---
 kernel/padata.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/padata.c b/kernel/padata.c
index 072f4ee..8e1bf9d 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -1086,18 +1086,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:
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/padata.c: Register hotcpu notifier after initialization
  2013-08-23 11:12 [PATCH] kernel/padata.c: Register hotcpu notifier after initialization Richard Weinberger
@ 2013-08-27  9:30 ` Steffen Klassert
  2013-08-29  4:43   ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Steffen Klassert @ 2013-08-27  9:30 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-crypto, linux-kernel, herbert, gang.chen

On Fri, Aug 23, 2013 at 01:12:33PM +0200, Richard Weinberger wrote:
> 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>

Looks ok,

Acked-by: Steffen Klassert <steffen.klassert@secunet.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/padata.c: Register hotcpu notifier after initialization
  2013-08-27  9:30 ` Steffen Klassert
@ 2013-08-29  4:43   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2013-08-29  4:43 UTC (permalink / raw)
  To: Steffen Klassert
  Cc: Richard Weinberger, linux-crypto, linux-kernel, gang.chen

On Tue, Aug 27, 2013 at 11:30:41AM +0200, Steffen Klassert wrote:
> On Fri, Aug 23, 2013 at 01:12:33PM +0200, Richard Weinberger wrote:
> > 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>
> 
> Looks ok,
> 
> Acked-by: Steffen Klassert <steffen.klassert@secunet.com>

Also applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-29  4:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-23 11:12 [PATCH] kernel/padata.c: Register hotcpu notifier after initialization Richard Weinberger
2013-08-27  9:30 ` Steffen Klassert
2013-08-29  4:43   ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox