ath: changed kmalloc to kmemdup
authorAndrei Epure <epure.andrei@gmail.com>
Sun, 10 Mar 2013 12:39:58 +0000 (14:39 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 18 Mar 2013 12:08:20 +0000 (14:08 +0200)
Signed-off-by: Andrei Epure <epure.andrei@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/usb.c

index 63948f6c9f17f3664f224539a5745bd5e288eca8..bed0d337712d3a6427fe5cee0a66e585fbd92fa9 100644 (file)
@@ -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 */