Commit 8cc782cd authored by Larry Finger's avatar Larry Finger Committed by Kalle Valo

rtlwifi: rtl_pci: Fix memory leak when hardware init fails

If the call to hw_init() fails for any of the drivers, the driver will
leak memory that was allocated in BT coexistence setup. Technically, each
of the drivers should have done this free; however placing it in rtl_pci
fixes all the drivers with only a single patch.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 84d31d3b
...@@ -1793,6 +1793,8 @@ static int rtl_pci_start(struct ieee80211_hw *hw) ...@@ -1793,6 +1793,8 @@ static int rtl_pci_start(struct ieee80211_hw *hw)
if (err) { if (err) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
"Failed to config hardware!\n"); "Failed to config hardware!\n");
kfree(rtlpriv->btcoexist.btc_context);
kfree(rtlpriv->btcoexist.wifi_only_context);
return err; return err;
} }
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT, rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT,
......
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