diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-09-13 08:15:17 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-09-20 14:11:36 +0200 |
commit | 6c3efbe77bc78bf49db851aec7f385be475afca6 (patch) | |
tree | b354bedf00fab9311b52ea4dfe1e7944ca9aa4a5 /drivers/net/wireless/broadcom/brcm80211/brcmsmac | |
parent | brcmfmac: remove set but not used variables 'sfdoff' and 'pad_size' (diff) | |
download | linux-6c3efbe77bc78bf49db851aec7f385be475afca6.tar.xz linux-6c3efbe77bc78bf49db851aec7f385be475afca6.zip |
brcmsmac: Use kvmalloc() for ucode allocations
The ucode chunk might be relatively large and the allocation with
kmalloc() may fail occasionally. Since the data isn't DMA-transferred
but by manual loops, we can use vmalloc instead of kmalloc.
For a better performance, though, kvmalloc() would be the best choice
in such a case, so let's replace with it.
Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1103431
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/broadcom/brcm80211/brcmsmac')
-rw-r--r-- | drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c index ecc89e718b9c..6255fb6d97a7 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c @@ -1578,10 +1578,10 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx) if (le32_to_cpu(hdr->idx) == idx) { pdata = wl->fw.fw_bin[i]->data + le32_to_cpu(hdr->offset); - *pbuf = kmemdup(pdata, len, GFP_KERNEL); + *pbuf = kvmalloc(len, GFP_KERNEL); if (*pbuf == NULL) goto fail; - + memcpy(*pbuf, pdata, len); return 0; } } @@ -1629,7 +1629,7 @@ int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes, u32 idx) */ void brcms_ucode_free_buf(void *p) { - kfree(p); + kvfree(p); } /* |