From 2f8514b8b03643a598706bf88214b10153324d11 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 4 May 2016 09:16:39 +0300 Subject: [PATCH] rtlwifi: rtl818x: silence uninitialized variable warning What about if "rtlphy->pwrgroup_cnt" is 2? In that case we would use an uninitialized "chnlgroup" variable and probably crash. Maybe that can't happen for some reason which is not obvious but in that case this patch is harmless. Setting it to zero seems like a standard default in the surrounding code so it's probably fine here as well. Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo --- drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c index 78a81c1e390b..9475aa2a8fa0 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c @@ -208,8 +208,7 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw, "Realtek regulatory, 40MHz, writeval = 0x%x\n", writeval); } else { - if (rtlphy->pwrgroup_cnt == 1) - chnlgroup = 0; + chnlgroup = 0; if (rtlphy->pwrgroup_cnt >= 3) { if (chnl <= 3) -- 2.30.2