]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
hostapd: ucode: unregister ucode/ubus objects when deleting an unstarted BSS
authorFelix Fietkau <nbd@nbd.name>
Fri, 10 Jul 2026 12:49:49 +0000 (14:49 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 16 Jul 2026 09:50:22 +0000 (11:50 +0200)
hostapd_free_hapd_data() skips hostapd_ucode_free_bss()/hostapd_ubus_free_bss()
for a bss that never started, so bss.delete() on such a bss freed hapd while
the ucode registry entry and ubus object still referenced it. Call both
explicitly before os_free(); they are idempotent for the started case.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/src/src/ap/ucode.c

index a739fb927715f1d01b2e9e232c4b3347c5caa73b..64653c6ae26eb8304b9ba5bca6cbc58025e9e2d9 100644 (file)
@@ -380,6 +380,9 @@ uc_hostapd_bss_delete(uc_vm_t *vm, size_t nargs)
 
        hostapd_drv_stop_ap(hapd);
        hostapd_bss_deinit(hapd);
+       /* deinit skips these for a bss that never started; both are idempotent */
+       hostapd_ucode_free_bss(hapd);
+       hostapd_ubus_free_bss(hapd);
        hostapd_remove_iface_bss_conf(iface->conf, hapd->conf);
        hostapd_config_free_bss(hapd->conf);
 #ifdef CONFIG_IEEE80211BE