From: Deepak Saxena Date: Mon, 27 Jul 2009 17:49:44 +0000 (-0700) Subject: net: irda: init spinlock after memcpy X-Git-Tag: v2.6.31-rc6~41^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cbb0a781a42f131e9c6836554f402cb85f8f38b;p=platform%2Fkernel%2Flinux-stable.git net: irda: init spinlock after memcpy 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 Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: David S. Miller --- 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);