Skip to contentSkip to conversation

ath: changed kmalloc to kmemdup

PATCH Applied Andrei Epure 2 participants 3 messages Mar 10, 2013 – Mar 18, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath: changed kmalloc to kmemdup

---
 drivers/net/wireless/ath/ath6kl/usb.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/ath/ath6kl/usb.c +1 -3
index 5fcd342..ffa1daa 100644
@@ -856,11 +856,9 @@ static int ath6kl_usb_submit_ctrl_out(struct ath6kl_usb *ar_usb,
 	int ret;
 
 	if (size > 0) {
-		buf = kmalloc(size, GFP_KERNEL);
+		buf = kmemdup(data, size, GFP_KERNEL);
 		if (buf == NULL)
 			return -ENOMEM;
-
-		memcpy(buf, data, size);
 	}
 
 	/* note: if successful returns number of bytes transfered */
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 1 line · Andrei Epure

Thanks, I'll take this. But please prefix ath6kl patches with "ath6kl:" in the future.

Signature · 5 lines
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#2 lore raw
In reply to Andrei Epure
Quoted 10 lines · Andrei Epure
---
 drivers/net/wireless/ath/ath6kl/usb.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/ath/ath6kl/usb.c +0 -0
index 5fcd342..ffa1daa 100644

drivers/net/wireless/ath/ath6kl/usb.c static int ath6kl_usb_submit_ctrl_out(struct ath6kl_usb *ar_usb, · line 862

Quoted 10 lines
drivers/net/wireless/ath/ath6kl/usb.c +1 -3
@@ -856,11 +856,9 @@ static int ath6kl_usb_submit_ctrl_out(struct ath6kl_usb *ar_usb,
 	int ret;
 
 	if (size > 0) {
-		buf = kmalloc(size, GFP_KERNEL);
+		buf = kmemdup(data, size, GFP_KERNEL);
 		if (buf == NULL)
 			return -ENOMEM;
-
-		memcpy(buf, data, size);
 	}

Thanks, applied to ath6kl.git.

Signature · 1 line
Kalle Valo