summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2021-12-23 19:28:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-11 17:35:13 +0300
commit18b224910edcf1bf120428be1f1030a6f245cf0a (patch)
tree39aecbdc162dc6def9c2b3c33f6347d2bd115e15 /net/mac80211
parent0ea8bb0811ba0ec22903cbb48ff2cd872382e8d4 (diff)
downloadlinux-18b224910edcf1bf120428be1f1030a6f245cf0a.tar.xz
mac80211: initialize variable have_higher_than_11mbit
commit 68a18ad71378a56858141c4449e02a30c829763e upstream. Clang static analysis reports this warnings mlme.c:5332:7: warning: Branch condition evaluates to a garbage value have_higher_than_11mbit) ^~~~~~~~~~~~~~~~~~~~~~~ have_higher_than_11mbit is only set to true some of the time in ieee80211_get_rates() but is checked all of the time. So have_higher_than_11mbit needs to be initialized to false. Fixes: 5d6a1b069b7f ("mac80211: set basic rates earlier") Signed-off-by: Tom Rix <trix@redhat.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/r/20211223162848.3243702-1-trix@redhat.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mlme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index dd42d83dbe33..89c648b035b9 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -5216,7 +5216,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
*/
if (new_sta) {
u32 rates = 0, basic_rates = 0;
- bool have_higher_than_11mbit;
+ bool have_higher_than_11mbit = false;
int min_rate = INT_MAX, min_rate_index = -1;
const struct cfg80211_bss_ies *ies;
int shift = ieee80211_vif_get_shift(&sdata->vif);