]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ath6kl: Use vmalloc instead of kmalloc for fw
authorVivek Natarajan <nataraja@qca.qualcomm.com>
Wed, 28 Mar 2012 13:51:25 +0000 (19:21 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 3 Apr 2012 18:26:01 +0000 (21:26 +0300)
Sometimes it has been observed that allocating a contiguous memory
of more than 100K fails with kmalloc. This has been modified to
use vmalloc instead.

Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com>
Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/core.c
drivers/net/wireless/ath/ath6kl/init.c

index 5c20a043a4704aa8591f03813a17c553bc85a2e0..fdb3b1decc76716c4c4f41004bb4f7a7bf3bfcc1 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/export.h>
+#include <linux/vmalloc.h>
 
 #include "debug.h"
 #include "hif-ops.h"
@@ -305,7 +306,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar)
 
        kfree(ar->fw_board);
        kfree(ar->fw_otp);
-       kfree(ar->fw);
+       vfree(ar->fw);
        kfree(ar->fw_patch);
        kfree(ar->fw_testscript);
 
index 092e4cddfed33e5ff4f972ef972e9a63c47d5a58..5949ab5357fd92fe3134f7b5d2d000d3f4ea6fa7 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/export.h>
 #include <linux/of.h>
 #include <linux/mmc/sdio_func.h>
+#include <linux/vmalloc.h>
 
 #include "core.h"
 #include "cfg80211.h"
@@ -928,13 +929,14 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
                        if (ar->fw != NULL)
                                break;
 
-                       ar->fw = kmemdup(data, ie_len, GFP_KERNEL);
+                       ar->fw = vmalloc(ie_len);
 
                        if (ar->fw == NULL) {
                                ret = -ENOMEM;
                                goto out;
                        }
 
+                       memcpy(ar->fw, data, ie_len);
                        ar->fw_len = ie_len;
                        break;
                case ATH6KL_FW_IE_PATCH_IMAGE: