]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Deinitialize BSS link on interface setup failure
authorRamasamy Kaliappan <ramasamy.kaliappan@oss.qualcomm.com>
Thu, 25 Sep 2025 10:25:11 +0000 (15:55 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 26 Sep 2025 18:59:39 +0000 (21:59 +0300)
Fix a segmentation fault in hostapd when interface setup fails in
hostapd_add_iface() due to invalid channel information. In this case,
the driver is deinitialized but the BSS link is not, leading to a crash
when the interface is brought down and up during stability testing.

Deinitialize the BSS link if interface setup fails to ensure proper
cleanup and prevent the crash.

Signed-off-by: Ramasamy Kaliappan <ramasamy.kaliappan@oss.qualcomm.com>
Signed-off-by: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
src/ap/hostapd.c

index 8da0ccafe07d9f91c4679e528b29232997492f41..161049fc3a3611962d111ce77df1f494051a9b34 100644 (file)
@@ -3879,6 +3879,8 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf)
                        }
 
                        if (hostapd_setup_interface(hapd_iface)) {
+                               /* Deinit link for the first bss */
+                               hostapd_bss_link_deinit(hapd_iface->bss[0]);
                                hostapd_deinit_driver(
                                        hapd_iface->bss[0]->driver,
                                        hapd_iface->bss[0]->drv_priv,