mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 06:37:59 +00:00
brcmfmac: fix brcmf_wiphy_wowl_params() NULL pointer dereference
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: 856d5a011c
("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>
This commit is contained in:
parent
33c740411a
commit
27a8aea130
1 changed files with 4 additions and 4 deletions
|
@ -6926,15 +6926,15 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
|
|||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue