Commit a0c7858e authored by Christian Engelmayer's avatar Christian Engelmayer Committed by Kalle Valo

rtlwifi: rtl8192de: Fix leak in _rtl92de_read_adapter_info()

In case rtl_get_hwinfo() fails, the function directly returns and leaks the
already allocated hwinfo memory. Go through the correct exit path.
Signed-off-by: default avatarChristian Engelmayer <cengelma@gmx.at>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 8af92af3
...@@ -1757,7 +1757,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw) ...@@ -1757,7 +1757,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
return; return;
if (rtl_get_hwinfo(hw, rtlpriv, HWSET_MAX_SIZE, hwinfo, params)) if (rtl_get_hwinfo(hw, rtlpriv, HWSET_MAX_SIZE, hwinfo, params))
return; goto exit;
_rtl92de_efuse_update_chip_version(hw); _rtl92de_efuse_update_chip_version(hw);
_rtl92de_read_macphymode_and_bandtype(hw, hwinfo); _rtl92de_read_macphymode_and_bandtype(hw, hwinfo);
...@@ -1790,6 +1790,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw) ...@@ -1790,6 +1790,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
break; break;
} }
rtlefuse->txpwr_fromeprom = true; rtlefuse->txpwr_fromeprom = true;
exit:
kfree(hwinfo); kfree(hwinfo);
} }
......
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