]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rtlwifi: rtl8723be: avoid undefined behavior
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 17 May 2016 22:46:23 +0000 (00:46 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 14 Jun 2016 14:20:50 +0000 (17:20 +0300)
Do not return undefined value for transmission power
if the rate is invalid.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c

index 445f681d08c03aa36748f97d3e3c5b170d820614..c5ca9dfb445caece7139dedf51d54a8c45619090 100644 (file)
@@ -1019,7 +1019,7 @@ static u8 _rtl8723be_get_txpower_index(struct ieee80211_hw *hw, u8 path,
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
        u8 index = (channel - 1);
-       u8 txpower;
+       u8 txpower = 0;
        u8 power_diff_byrate = 0;
 
        if (channel > 14 || channel < 1) {