From da92bc743f906f7767e693a5c93df401de3db510 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 7 Jan 2022 14:26:05 +0100 Subject: [PATCH] 4.9-stable patches added patches: mac80211-initialize-variable-have_higher_than_11mbit.patch --- ...ize-variable-have_higher_than_11mbit.patch | 41 +++++++++++++++++++ queue-4.9/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 queue-4.9/mac80211-initialize-variable-have_higher_than_11mbit.patch diff --git a/queue-4.9/mac80211-initialize-variable-have_higher_than_11mbit.patch b/queue-4.9/mac80211-initialize-variable-have_higher_than_11mbit.patch new file mode 100644 index 00000000000..772a125ed18 --- /dev/null +++ b/queue-4.9/mac80211-initialize-variable-have_higher_than_11mbit.patch @@ -0,0 +1,41 @@ +From 68a18ad71378a56858141c4449e02a30c829763e Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Thu, 23 Dec 2021 08:28:48 -0800 +Subject: mac80211: initialize variable have_higher_than_11mbit + +From: Tom Rix + +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 +Reviewed-by: Nick Desaulniers +Link: https://lore.kernel.org/r/20211223162848.3243702-1-trix@redhat.com +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/mlme.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -4450,7 +4450,7 @@ static int ieee80211_prep_connection(str + + 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; + struct ieee80211_chanctx_conf *chanctx_conf; + const struct cfg80211_bss_ies *ies; diff --git a/queue-4.9/series b/queue-4.9/series index 8e2fe32e61e..f1614480f4b 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -3,3 +3,4 @@ tracing-fix-check-for-trace_percpu_buffer-validity-in-get_trace_buf.patch tracing-tag-trace_percpu_buffer-as-a-percpu-pointer.patch virtio_pci-support-surprise-removal-of-virtio-pci-device.patch ieee802154-atusb-fix-uninit-value-in-atusb_set_extended_addr.patch +mac80211-initialize-variable-have_higher_than_11mbit.patch -- 2.47.3