diff mbox

net: irda: init spinlock after memcpy

Message ID alpine.LFD.2.00.0907271407590.2936@localhost.localdomain
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Thomas Gleixner July 27, 2009, 12:12 p.m. UTC
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>
---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller July 27, 2009, 5:49 p.m. UTC | #1
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);