MLD control interface creation failed randomly because the existing
control interface was not properly cleaned up. During the failure case
handling, the memory allocated for hapd->mld is freed in
hostapd_bss_setup_multi_link(). Subsequently, when performing MLD link
removal during the interface down, hostapd_mld_remove_link() attempts to
access the mld pointer without NULL check, causing a segmentation fault.
To prevent this issue, add a validation to check if the mld pointer
is NULL before accessing it.
Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
}
/* Put all freeing logic above this */
- if (!hapd->mld->num_links)
+ if (!hapd->mld || !hapd->mld->num_links)
return;
/* If not started, not yet linked to the MLD. However, the first