aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-03-16 11:41:49 -0400
committerKalle Valo <kvalo@codeaurora.org>2018-03-27 05:09:05 -0400
commitb1c2d0f2507bf56d9f4dbd46dc4b99240fbd187c (patch)
treeaedcc76006868738bc387d271b4ce19d65a00cf8
parent48eaee3f272a5bfe6986d07c51f6975d3c2f74d1 (diff)
brcmsmac: allocate ucode with GFP_KERNEL
The brcms_ucode_init_buf() duplicates the ucode chunks via kmemdup() with GFP_ATOMIC as a precondition of wl->lock acquired. This caused allocation failures sometimes as reported in the bugzilla below. When looking at the the real usage, one can find that it's called solely from brcms_request_fw(), and it's obviously outside the lock. Hence we can use GFP_KERNEL there safely for avoiding such allocation errors. Bugzilla: http://bugzilla.suse.com/show_bug.cgi?id=1085174 Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
index 8e58f6800483..ecc89e718b9c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
@@ -1563,7 +1563,7 @@ void brcms_free_timer(struct brcms_timer *t)
1563} 1563}
1564 1564
1565/* 1565/*
1566 * precondition: perimeter lock has been acquired 1566 * precondition: no locking required
1567 */ 1567 */
1568int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx) 1568int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx)
1569{ 1569{
@@ -1578,7 +1578,7 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx)
1578 if (le32_to_cpu(hdr->idx) == idx) { 1578 if (le32_to_cpu(hdr->idx) == idx) {
1579 pdata = wl->fw.fw_bin[i]->data + 1579 pdata = wl->fw.fw_bin[i]->data +
1580 le32_to_cpu(hdr->offset); 1580 le32_to_cpu(hdr->offset);
1581 *pbuf = kmemdup(pdata, len, GFP_ATOMIC); 1581 *pbuf = kmemdup(pdata, len, GFP_KERNEL);
1582 if (*pbuf == NULL) 1582 if (*pbuf == NULL)
1583 goto fail; 1583 goto fail;
1584 1584