aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-05-18 20:22:53 +0200
committerJohn W. Linville <linville@tuxdriver.com>2012-05-25 11:16:16 -0400
commitedb9bc9a1e08f54adfdb4f4d31bca5a15aeb8ef0 (patch)
tree23b4683dc5897953fb92088301264c7ddc3ac23a /drivers/net/wireless
parent885ba1da689299ec52e646ca1a2429b8de55f364 (diff)
brcmfmac: use vmalloc to allocate mem for the firmware
The firmware is more than 300KB big and you should not use kmalloc for such big allocations. This allocation with kmalloc failed on my mips based device (BCM47186). Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/usb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index 1d67ecf681b..3e352475626 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -28,6 +28,7 @@
#include <linux/uaccess.h>
#include <linux/firmware.h>
#include <linux/usb.h>
+#include <linux/vmalloc.h>
#include <net/cfg80211.h>
#include <defs.h>
@@ -1239,7 +1240,7 @@ static int brcmf_usb_get_fw(struct brcmf_usbdev_info *devinfo)
return -EINVAL;
}
- devinfo->image = kmalloc(fw->size, GFP_ATOMIC); /* plus nvram */
+ devinfo->image = vmalloc(fw->size); /* plus nvram */
if (!devinfo->image)
return -ENOMEM;
@@ -1602,7 +1603,7 @@ static struct usb_driver brcmf_usbdrvr = {
void brcmf_usb_exit(void)
{
usb_deregister(&brcmf_usbdrvr);
- kfree(g_image.data);
+ vfree(g_image.data);
g_image.data = NULL;
g_image.len = 0;
}