Commit c3a9392e authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Jeff Garzik

[PATCH] kmemdup() cleanup in drivers/net

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.
Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent bf793295
...@@ -1906,9 +1906,7 @@ static void __init de21041_get_srom_info (struct de_private *de) ...@@ -1906,9 +1906,7 @@ static void __init de21041_get_srom_info (struct de_private *de)
de->media[i].csr15 = t21041_csr15[i]; de->media[i].csr15 = t21041_csr15[i];
} }
de->ee_data = kmalloc(DE_EEPROM_SIZE, GFP_KERNEL); de->ee_data = kmemdup(&ee_data[0], DE_EEPROM_SIZE, GFP_KERNEL);
if (de->ee_data)
memcpy(de->ee_data, &ee_data[0], DE_EEPROM_SIZE);
return; return;
......
...@@ -7568,11 +7568,10 @@ static int ipw2100_wx_set_genie(struct net_device *dev, ...@@ -7568,11 +7568,10 @@ static int ipw2100_wx_set_genie(struct net_device *dev,
return -EINVAL; return -EINVAL;
if (wrqu->data.length) { if (wrqu->data.length) {
buf = kmalloc(wrqu->data.length, GFP_KERNEL); buf = kmemdup(extra, wrqu->data.length, GFP_KERNEL);
if (buf == NULL) if (buf == NULL)
return -ENOMEM; return -ENOMEM;
memcpy(buf, extra, wrqu->data.length);
kfree(ieee->wpa_ie); kfree(ieee->wpa_ie);
ieee->wpa_ie = buf; ieee->wpa_ie = buf;
ieee->wpa_ie_len = wrqu->data.length; ieee->wpa_ie_len = wrqu->data.length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment