source: branches/chaos_calmer/package/kernel/mac80211/patches/351-0048-brcmfmac-fix-memory-leak-in-brcmf_fill_bss_param.patch @ 49407

Last change on this file since 49407 was 49407, checked in by rmilecki, 12 months ago

mac80211: brcmfmac: backport changes from 2016-09-27

This fixes memory leaks, some possible crashes and bug that could cause
WARNING on every add_key/del_key call. It also replaces WARNING with
a simple message. They may still occur e.g. on station going out of
range and A-MPDU stall in the firmware.

Signed-off-by: Rafał Miłecki <rafal@…>

File size: 1.5 KB
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

    From 23e9c128adb2038c27a424a5f91136e7fa3e0dc6 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
    Date: Wed, 21 Sep 2016 08:23:24 +0200
    Subject: [PATCH] brcmfmac: fix memory leak in brcmf_fill_bss_param
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    This function is called from get_station callback which means that every
    time user space was getting/dumping station(s) we were leaking 2 KiB.
    
    Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
    Fixes: 1f0dc59a6de ("brcmfmac: rework .get_station() callback")
    Cc: stable@vger.kernel.org # 4.2+
    Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    ---
     drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    a b static void brcmf_fill_bss_param(struct 
    24632463                                     WL_BSS_INFO_MAX); 
    24642464        if (err) { 
    24652465                brcmf_err("Failed to get bss info (%d)\n", err); 
    2466                 return; 
     2466                goto out_kfree; 
    24672467        } 
    24682468        si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); 
    24692469        si->bss_param.beacon_interval = le16_to_cpu(buf->bss_le.beacon_period); 
    static void brcmf_fill_bss_param(struct 
    24752475                si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE; 
    24762476        if (capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) 
    24772477                si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME; 
     2478 
     2479out_kfree: 
     2480        kfree(buf); 
    24782481} 
    24792482 
    24802483static s32 
Note: See TracBrowser for help on using the repository browser.