lkml.org 
[lkml]   [2018]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.18 102/197] brcmfmac: fix brcmf_wiphy_wowl_params() NULL pointer dereference
    Date
    4.18-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Winnie Chang <winnie.chang@cypress.com>

    [ Upstream commit 27a8aea13053700ad2a08189024df7e341d1ee51 ]

    The kernel BUG happens when wowl is enabled from firmware. In
    brcmf_wiphy_wowl_params(), cfg is a NULL pointer because it is
    drvr->config returned from wiphy_to_cfg(), and drvr->config is not set
    yet. To fix it, set drvr->config before brcmf_setup_wiphy() which
    calls brcmf_wiphy_wowl_params().

    Fixes: 856d5a011c86 ("brcmfmac: allocate struct brcmf_pub instance using wiphy_new()")
    Signed-off-by: Winnie Chang <winnie.chang@cypress.com>
    Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
    +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
    @@ -6926,15 +6926,15 @@ struct brcmf_cfg80211_info *brcmf_cfg802
    cfg->d11inf.io_type = (u8)io_type;
    brcmu_d11_attach(&cfg->d11inf);

    - err = brcmf_setup_wiphy(wiphy, ifp);
    - if (err < 0)
    - goto priv_out;
    -
    /* regulatory notifer below needs access to cfg so
    * assign it now.
    */
    drvr->config = cfg;

    + err = brcmf_setup_wiphy(wiphy, ifp);
    + if (err < 0)
    + goto priv_out;
    +
    brcmf_dbg(INFO, "Registering custom regulatory\n");
    wiphy->reg_notifier = brcmf_cfg80211_reg_notifier;
    wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;

    \
     
     \ /
      Last update: 2018-09-13 15:58    [W:4.182 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site