summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordastarothx2026-05-23 16:40:20 +0000
committerChristian Marangi2026-05-24 11:12:19 +0000
commit54cced5b2f2c3b6f92a1b81ca3764349a93f96af (patch)
tree1db79a50d24a0fc2db873c6c6335a5a1bfb3d2bd
parent8dff4c9a340371b1e1f10b03ac06340d15f60e86 (diff)
downloadopenwrt-54cced5b2f2c3b6f92a1b81ca3764349a93f96af.tar.gz
wifi-scripts: ucode: fix null dereference for 6GHz-only radios
he_phy_cap and he_mac_cap in phy_capabilities are only populated inside the iftype_data loop. On 6GHz-only radios (e.g. QCN9074/ath11k_pci), when capability bytes are unavailable they remain null, causing null dereferences in device_htmode_append(): Reference error: left-hand side expression is null if (!(he_phy_cap[3] & 0x80)) Initialise both to [] before the loop and guard the consumer side with ?? [] so bitwise checks conservatively disable beamformer/beamformee/twt features rather than crashing. Link: https://github.com/openwrt/openwrt/issues/23488 Signed-off-by: dastarothx <darkastalier@gmail.com> (cherry picked from commit feca0b4507b9175b95a59701462d550eb0b855c0) Link: https://github.com/openwrt/openwrt/pull/23503 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc2
1 files changed, 2 insertions, 0 deletions
diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
index cc7b9e3870..cfd652cc2f 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc
@@ -467,6 +467,8 @@ function device_capabilities(config) {
phy_capabilities.ht_capa = band.ht_capa ?? 0;
phy_capabilities.vht_capa = band.vht_capa ?? 0;
+ phy_capabilities.he_mac_cap = [];
+ phy_capabilities.he_phy_cap = [];
for (let iftype in band.iftype_data) {
if (!iftype.iftypes.ap)
continue;