Commit 8437754c authored by Vivek Natarajan's avatar Vivek Natarajan Committed by Kalle Valo

ath6kl: Use vmalloc instead of kmalloc for fw

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: default avatarPingYang Zhang <pingzhan@qca.qualcomm.com>
Signed-off-by: default avatarVivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent f599359c
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/vmalloc.h>
#include "debug.h" #include "debug.h"
#include "hif-ops.h" #include "hif-ops.h"
...@@ -305,7 +306,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar) ...@@ -305,7 +306,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar)
kfree(ar->fw_board); kfree(ar->fw_board);
kfree(ar->fw_otp); kfree(ar->fw_otp);
kfree(ar->fw); vfree(ar->fw);
kfree(ar->fw_patch); kfree(ar->fw_patch);
kfree(ar->fw_testscript); kfree(ar->fw_testscript);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_func.h>
#include <linux/vmalloc.h>
#include "core.h" #include "core.h"
#include "cfg80211.h" #include "cfg80211.h"
...@@ -928,13 +929,14 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name) ...@@ -928,13 +929,14 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
if (ar->fw != NULL) if (ar->fw != NULL)
break; break;
ar->fw = kmemdup(data, ie_len, GFP_KERNEL); ar->fw = vmalloc(ie_len);
if (ar->fw == NULL) { if (ar->fw == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
memcpy(ar->fw, data, ie_len);
ar->fw_len = ie_len; ar->fw_len = ie_len;
break; break;
case ATH6KL_FW_IE_PATCH_IMAGE: case ATH6KL_FW_IE_PATCH_IMAGE:
......
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