Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1757,7 +1757,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
		return;

	if (rtl_get_hwinfo(hw, rtlpriv, HWSET_MAX_SIZE, hwinfo, params))
		return;
		goto exit;

	_rtl92de_efuse_update_chip_version(hw);
	_rtl92de_read_macphymode_and_bandtype(hw, hwinfo);
@@ -1790,6 +1790,7 @@ static void _rtl92de_read_adapter_info(struct ieee80211_hw *hw)
		break;
	}
	rtlefuse->txpwr_fromeprom = true;
exit:
	kfree(hwinfo);
}