diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2019-08-26 17:03:44 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-09-03 16:30:04 +0300 |
commit | 8cc782cd997dc4eb3ac183228d563727884ba874 (patch) | |
tree | 29e1b6d1aaef87b6d70d4e71b36277f65da9815c /drivers | |
parent | 84d31d3b6234919953855f758401279208ee3b58 (diff) |
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: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/pci.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index 7d96fe5f1a44..6087ec7a90a6 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -1793,6 +1793,8 @@ static int rtl_pci_start(struct ieee80211_hw *hw) if (err) { RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "Failed to config hardware!\n"); + kfree(rtlpriv->btcoexist.btc_context); + kfree(rtlpriv->btcoexist.wifi_only_context); return err; } rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT, |