Skip to contentSkip to conversation

net: irda: init spinlock after memcpy

PATCH Applied Thomas Gleixner 2 participants 2 messages Jul 27, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: irda: init spinlock after memcpy

From: Deepak Saxena <[email protected]>

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

---

net/irda/irttp.c +1 -0
index ecf4eb2..9cb79f9 100644
@@ -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);