[openwrt/openwrt] wifi-scripts: netifd: fix null dereference in config_init for missing devices
LEDE Commits
lede-commits at lists.infradead.org
Mon Feb 16 00:19:54 PST 2026
nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8b994ed3970ffd02ee77889304ca32bdbecdb1f3
commit 8b994ed3970ffd02ee77889304ca32bdbecdb1f3
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Feb 15 08:23:57 2026 +0000
wifi-scripts: netifd: fix null dereference in config_init for missing devices
Add optional chaining when accessing device config in the wifi-iface
loop to handle cases where a referenced device doesn't exist.
Signed-off-by: Felix Fietkau <nbd at nbd.name>
(cherry picked from commit ebd2fefea5152d032cded1ccc7cf6e731b5bbcc2)
---
package/network/config/wifi-scripts/files/lib/netifd/wireless.uc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
index fef644e1f4..fa2edbee12 100644
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc
@@ -165,7 +165,7 @@ function config_init(uci)
let mlo_vif = parse_bool(data.mlo);
let radios = map(dev_names, (v) => radio_idx[v]);
radios = filter(radios, (v) => v != null);
- let radio_config = map(dev_names, (v) => devices[v].config);
+ let radio_config = map(dev_names, (v) => devices[v]?.config);
let ifname;
let mlo_created = false;
More information about the lede-commits
mailing list