ath79: update WA/XC devices UBNT_VERSION to 8.7.4
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / subsys / 780-avoid-crashing-missing-band.patch
1 From: David Bauer <mail@david-bauer.net>
2 Date: Thu, 30 Nov 2023 07:32:52 +0100
3 Subject: [PATCH] mac80211: avoid crashing on invalid band info
4
5 Frequent crashes have been observed on MT7916 based platforms. While the
6 root of these crashes are currently unknown, they happen when decoding
7 rate information of connected STAs in AP mode. The rate-information is
8 associated with a band which is not available on the PHY.
9
10 Check for this condition in order to avoid crashing the whole system.
11 This patch should be removed once the roout cause has been found and
12 fixed.
13
14 Link: https://github.com/freifunk-gluon/gluon/issues/2980
15
16 Signed-off-by: David Bauer <mail@david-bauer.net>
17 ---
18
19 --- a/net/mac80211/sta_info.c
20 +++ b/net/mac80211/sta_info.c
21 @@ -2423,6 +2423,13 @@ static void sta_stats_decode_rate(struct
22
23 sband = local->hw.wiphy->bands[band];
24
25 + if (!sband) {
26 + wiphy_warn(local->hw.wiphy,
27 + "Invalid band %d\n",
28 + band);
29 + break;
30 + }
31 +
32 if (WARN_ON_ONCE(!sband->bitrates))
33 break;
34