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>
}
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,