Commit cb853da3 authored by Arend Van Spriel's avatar Arend Van Spriel Committed by Kalle Valo

brcmfmac: fix memory leak in brcmf_cfg80211_attach()

In brcmf_cfg80211_attach() there was one error path not properly
handled as it leaked memory allocated in brcmf_btcoex_attach().
Reviewed-by: default avatarHante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: default avatarFranky Lin <franky.lin@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent ad688cdb
...@@ -6868,7 +6868,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, ...@@ -6868,7 +6868,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
err = brcmf_p2p_attach(cfg, p2pdev_forced); err = brcmf_p2p_attach(cfg, p2pdev_forced);
if (err) { if (err) {
brcmf_err("P2P initilisation failed (%d)\n", err); brcmf_err("P2P initialisation failed (%d)\n", err);
goto wiphy_unreg_out; goto wiphy_unreg_out;
} }
err = brcmf_btcoex_attach(cfg); err = brcmf_btcoex_attach(cfg);
...@@ -6893,7 +6893,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, ...@@ -6893,7 +6893,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
err = brcmf_fweh_activate_events(ifp); err = brcmf_fweh_activate_events(ifp);
if (err) { if (err) {
brcmf_err("FWEH activation failed (%d)\n", err); brcmf_err("FWEH activation failed (%d)\n", err);
goto wiphy_unreg_out; goto detach;
} }
/* Fill in some of the advertised nl80211 supported features */ /* Fill in some of the advertised nl80211 supported features */
...@@ -6908,6 +6908,9 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, ...@@ -6908,6 +6908,9 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
return cfg; return cfg;
detach:
brcmf_btcoex_detach(cfg);
brcmf_p2p_detach(&cfg->p2p);
wiphy_unreg_out: wiphy_unreg_out:
wiphy_unregister(cfg->wiphy); wiphy_unregister(cfg->wiphy);
priv_out: priv_out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment