Skip to content

Commit 54cced5

Browse files
dastarothxAnsuel
authored andcommitted
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: openwrt#23488 Signed-off-by: dastarothx <darkastalier@gmail.com> (cherry picked from commit feca0b4) Link: openwrt#23503 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
1 parent 8dff4c9 commit 54cced5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi

package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ function device_capabilities(config) {
467467

468468
phy_capabilities.ht_capa = band.ht_capa ?? 0;
469469
phy_capabilities.vht_capa = band.vht_capa ?? 0;
470+
phy_capabilities.he_mac_cap = [];
471+
phy_capabilities.he_phy_cap = [];
470472
for (let iftype in band.iftype_data) {
471473
if (!iftype.iftypes.ap)
472474
continue;

0 commit comments

Comments
 (0)