diff mbox

[26/37] drivers/net/wireless/ipw2x00: Use kmemdup

Message ID Pine.LNX.4.64.1005152320450.21345@ask.diku.dk (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Julia Lawall May 15, 2010, 9:21 p.m. UTC
None
diff mbox

Patch

diff -u -p a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -6626,13 +6626,12 @@  static int ipw_wx_set_genie(struct net_d
 		return -EINVAL;
 
 	if (wrqu->data.length) {
-		buf = kmalloc(wrqu->data.length, GFP_KERNEL);
+		buf = kmemdup(extra, wrqu->data.length, GFP_KERNEL);
 		if (buf == NULL) {
 			err = -ENOMEM;
 			goto out;
 		}
 
-		memcpy(buf, extra, wrqu->data.length);
 		kfree(ieee->wpa_ie);
 		ieee->wpa_ie = buf;
 		ieee->wpa_ie_len = wrqu->data.length;