Skip to content

Commit

Permalink
net: irda: init spinlock after memcpy
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Deepak Saxena authored and David S. Miller committed Jul 27, 2009
1 parent 8bae1b2 commit 0cbb0a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/irda/irttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0cbb0a7

Please sign in to comment.