Skip to contentSkip to conversation

iwlwifi: mvm: initialize seq variable

PATCH In review Tom Rix 2 participants 2 messages Apr 1, 2022 – Apr 5, 2022

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 iwlwifi: mvm: initialize seq variable

Clang static analysis reports this issue
d3.c:567:22: warning: The left operand of '>' is
a garbage value
if (seq.tkip.iv32 > cur_rx_iv32)

      ~~~~~~~~~~~~~ ^

seq is never initialized. Call ieee80211_get_key_rx_seq() to initialize seq.

Fixes 0419e5e672d6 ("iwlwifi: mvm: d3: separate TKIP data from key iteration")
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +1 -0
index a995bba0ba81..9b190b3ce6c1 100644
@@ -563,6 +563,7 @@ static void iwl_mvm_wowlan_get_tkip_data(struct ieee80211_hw *hw,
 		}
 
 		for (i = 0; i < IWL_NUM_RSC; i++) {
+			ieee80211_get_key_rx_seq(key, i, &seq);
 			/* wrapping isn't allowed, AP must rekey */
 			if (seq.tkip.iv32 > cur_rx_iv32)
 				cur_rx_iv32 = seq.tkip.iv32;
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tom Rix

Clang static analysis reports this issue
d3.c:567:22: warning: The left operand of '>' is
a garbage value
if (seq.tkip.iv32 > cur_rx_iv32)

Quoted 7 lines
      ~~~~~~~~~~~~~ ^

seq is never initialized. Call ieee80211_get_key_rx_seq() to initialize seq.

Fixes 0419e5e672d6 ("iwlwifi: mvm: d3: separate TKIP data from key iteration")

Thanks for the patch!

Quoted 19 lines
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +1 -1
index a995bba0ba81..9b190b3ce6c1 100644
@@ -563,6 +563,7 @@ static void iwl_mvm_wowlan_get_tkip_data(struct ieee80211_hw *hw,
                }
 
                for (i = 0; i < IWL_NUM_RSC; i++) {
+                       ieee80211_get_key_rx_seq(key, i, &seq);
                        /* wrapping isn't allowed, AP must rekey */
                        if (seq.tkip.iv32 > cur_rx_iv32)
                                cur_rx_iv32 = seq.tkip.iv32;
--

2.27.0

Signature · 2 lines
Thanks,
~Nick Desaulniers