summaryrefslogtreecommitdiffstats
path: root/net/atm/lec.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-11-21 01:14:33 -0200
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:30:13 -0800
commit2afe37cdffa96f69c9096e6d4a10a275c9c7d2c9 (patch)
treeb5898081aa18d60bf95595d906de39cc0e617787 /net/atm/lec.c
parent66625984ca94552f75836596e0e83f3e5594bd58 (diff)
downloadkernel-crypto-2afe37cdffa96f69c9096e6d4a10a275c9c7d2c9.tar.gz
kernel-crypto-2afe37cdffa96f69c9096e6d4a10a275c9c7d2c9.tar.xz
kernel-crypto-2afe37cdffa96f69c9096e6d4a10a275c9c7d2c9.zip
[ATM]: Use kmemdup & kzalloc where applicable
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/atm/lec.c')
-rw-r--r--net/atm/lec.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 9f5f931743b..5946ec63724 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1321,11 +1321,10 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
if (table == NULL)
return -1;
- *tlvs = kmalloc(table->sizeoftlvs, GFP_ATOMIC);
+ *tlvs = kmemdup(table->tlvs, table->sizeoftlvs, GFP_ATOMIC);
if (*tlvs == NULL)
return -1;
- memcpy(*tlvs, table->tlvs, table->sizeoftlvs);
*sizeoftlvs = table->sizeoftlvs;
return 0;
@@ -1364,11 +1363,10 @@ static int lane2_associate_req(struct net_device *dev, u8 *lan_dst,
kfree(priv->tlvs); /* NULL if there was no previous association */
- priv->tlvs = kmalloc(sizeoftlvs, GFP_KERNEL);
+ priv->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL);
if (priv->tlvs == NULL)
return (0);
priv->sizeoftlvs = sizeoftlvs;
- memcpy(priv->tlvs, tlvs, sizeoftlvs);
skb = alloc_skb(sizeoftlvs, GFP_ATOMIC);
if (skb == NULL)
@@ -1409,12 +1407,10 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
kfree(entry->tlvs);
- entry->tlvs = kmalloc(sizeoftlvs, GFP_KERNEL);
+ entry->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL);
if (entry->tlvs == NULL)
return;
-
entry->sizeoftlvs = sizeoftlvs;
- memcpy(entry->tlvs, tlvs, sizeoftlvs);
#endif
#if 0
printk("lec.c: lane2_associate_ind()\n");