netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: irda: init spinlock after memcpy
@ 2009-07-27 12:12 Thomas Gleixner
  2009-07-27 17:49 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Gleixner @ 2009-07-27 12:12 UTC (permalink / raw)
  To: netdev; +Cc: David Miller

From: Deepak Saxena <dsaxena@mvista.com>

irttp_dup() copies a tsap_cb struct, but does not initialize the
spinlock in the new structure, which confuses lockdep.

Signed-off-by: Deepak Saxena <dsaxena@mvista.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index ecf4eb2..9cb79f9 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -1453,6 +1453,7 @@ struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance)
 	}
 	/* Dup */
 	memcpy(new, orig, sizeof(struct tsap_cb));
+	spin_lock_init(&new->lock);
 
 	/* We don't need the old instance any more */
 	spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags);

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

* Re: [PATCH] net: irda: init spinlock after memcpy
  2009-07-27 12:12 [PATCH] net: irda: init spinlock after memcpy Thomas Gleixner
@ 2009-07-27 17:49 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-07-27 17:49 UTC (permalink / raw)
  To: tglx; +Cc: netdev

From: Thomas Gleixner <tglx@linutronix.de>
Date: Mon, 27 Jul 2009 14:12:24 +0200 (CEST)

> From: Deepak Saxena <dsaxena@mvista.com>
> 
> irttp_dup() copies a tsap_cb struct, but does not initialize the
> spinlock in the new structure, which confuses lockdep.
> 
> Signed-off-by: Deepak Saxena <dsaxena@mvista.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Applied.

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

end of thread, other threads:[~2009-07-27 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27 12:12 [PATCH] net: irda: init spinlock after memcpy Thomas Gleixner
2009-07-27 17:49 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).