[IRDA]: Use kmemdup where applicable
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
committed by
David S. Miller
parent
8b2ed4bba4
commit
b3ab09f9e1
@ -641,15 +641,13 @@ struct lsap_cb *irlmp_dup(struct lsap_cb *orig, void *instance)
|
||||
}
|
||||
|
||||
/* Allocate a new instance */
|
||||
new = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC);
|
||||
new = kmemdup(orig, sizeof(*new), GFP_ATOMIC);
|
||||
if (!new) {
|
||||
IRDA_DEBUG(0, "%s(), unable to kmalloc\n", __FUNCTION__);
|
||||
spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock,
|
||||
flags);
|
||||
return NULL;
|
||||
}
|
||||
/* Dup */
|
||||
memcpy(new, orig, sizeof(struct lsap_cb));
|
||||
/* new->lap = orig->lap; => done in the memcpy() */
|
||||
/* new->slsap_sel = orig->slsap_sel; => done in the memcpy() */
|
||||
new->conn_skb = NULL;
|
||||
|
Reference in New Issue
Block a user