Skip to content

Commit 68a18ad

Browse files
Tom Rixjmberg-intel
authored andcommitted
mac80211: initialize variable have_higher_than_11mbit
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: 5d6a1b0 ("mac80211: set basic rates earlier") Signed-off-by: Tom Rix <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 1ef5e1d commit 68a18ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mac80211/mlme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5265,7 +5265,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
52655265
*/
52665266
if (new_sta) {
52675267
u32 rates = 0, basic_rates = 0;
5268-
bool have_higher_than_11mbit;
5268+
bool have_higher_than_11mbit = false;
52695269
int min_rate = INT_MAX, min_rate_index = -1;
52705270
const struct cfg80211_bss_ies *ies;
52715271
int shift = ieee80211_vif_get_shift(&sdata->vif);

0 commit comments

Comments
 (0)