X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=net%2Firda%2Firttp.c;h=5c93f2952b082b6fa5ef6c0bc8211dfdb68f3693;hb=72f318897e50c29b91efd1ed24515a93c138a2ba;hp=32e3bb0261105f51ccc24e21026a54e90829e855;hpb=42a0ddcd484d0470d4c1b114ffb6be1d35f8ac6b;p=karo-tx-linux.git diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 32e3bb026110..5c93f2952b08 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c @@ -1461,14 +1461,12 @@ struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance) } /* Allocate a new instance */ - new = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); + new = kmemdup(orig, sizeof(struct tsap_cb), GFP_ATOMIC); if (!new) { IRDA_DEBUG(0, "%s(), unable to kmalloc\n", __func__); spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags); return NULL; } - /* Dup */ - memcpy(new, orig, sizeof(struct tsap_cb)); spin_lock_init(&new->lock); /* We don't need the old instance any more */