From: Ramasamy Kaliappan Date: Thu, 25 Sep 2025 10:25:11 +0000 (+0530) Subject: AP MLD: Deinitialize BSS link on interface setup failure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e275c3dc70e1c2947e02e43aeee6c4f9975c3dc7;p=thirdparty%2Fhostap.git AP MLD: Deinitialize BSS link on interface setup failure 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 Signed-off-by: Aaradhana Sahu --- diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 8da0ccafe..161049fc3 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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,