projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
efd0bf9
)
irttp: Use kmemdup rather than duplicating its implementation
author
Thomas Meyer
<thomas@m3y3r.de>
Thu, 17 Nov 2011 12:43:40 +0000
(12:43 +0000)
committer
David S. Miller
<davem@davemloft.net>
Mon, 21 Nov 2011 20:02:17 +0000
(15:02 -0500)
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/irda/irttp.c
patch
|
blob
|
history
diff --git
a/net/irda/irttp.c
b/net/irda/irttp.c
index 32e3bb0261105f51ccc24e21026a54e90829e855..5c93f2952b082b6fa5ef6c0bc8211dfdb68f3693 100644
(file)
--- 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 = km
alloc(
sizeof(struct tsap_cb), GFP_ATOMIC);
+ new = km
emdup(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 */