]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: rtw89: fw: scan offload prohibit all 6 GHz channel if no 6 GHz sband
authorZong-Zhe Yang <kevin_yang@realtek.com>
Fri, 12 Apr 2024 11:57:23 +0000 (19:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jul 2024 10:50:56 +0000 (12:50 +0200)
[ Upstream commit bb38626f3f97e16e6d368a9ff6daf320f3fe31d9 ]

We have some policy via BIOS to block uses of 6 GHz. In this case, 6 GHz
sband will be NULL even if it is WiFi 7 chip. So, add NULL handling here
to avoid crash.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240412115729.8316-3-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/realtek/rtw89/fw.c

index 6c75ebbb21caa175e1b3f386b1d2b5bf9515c9eb..ef86389545ffb26a2925a9c2a01bb22ebc6f01c1 100644 (file)
@@ -4646,6 +4646,10 @@ static void rtw89_scan_get_6g_disabled_chan(struct rtw89_dev *rtwdev,
        u8 i, idx;
 
        sband = rtwdev->hw->wiphy->bands[NL80211_BAND_6GHZ];
+       if (!sband) {
+               option->prohib_chan = U64_MAX;
+               return;
+       }
 
        for (i = 0; i < sband->n_channels; i++) {
                chan = &sband->channels[i];