From e0aac2cd3da33f03dbff807f4f6c15a555aa7ea6 Mon Sep 17 00:00:00 2001 From: Govindaraj Saminathan Date: Wed, 27 Nov 2024 12:55:35 +0530 Subject: [PATCH] AP MLD: Add NULL check for mld pointer during MLD link removal 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 --- src/ap/hostapd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index c8751a247..dc50ad1bc 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -633,7 +633,7 @@ static void hostapd_bss_link_deinit(struct hostapd_data *hapd) } /* 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 -- 2.47.3