[PATCH v2 1/2] AP: Guard against survey list not being initialized

Benjamin Berg benjamin at sipsolutions.net
Fri Nov 21 02:05:52 PST 2025


From: Benjamin Berg <benjamin.berg at intel.com>

Do not try to store survey information in the unusual event that the
channels survey_list is not initialized. That should not usually happen,
but could e.g. be the case if the regulatory changes and new channels
are added after the ACS scan was started.

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/ap/drv_callbacks.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index 16a15076cf..201687fd37 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -2245,6 +2245,8 @@ void hostapd_event_get_survey(struct hostapd_iface *iface,
 			continue;
 		if (chan->flag & HOSTAPD_CHAN_DISABLED)
 			continue;
+		if (!(chan->flag & HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED))
+			continue;
 
 		dl_list_del(&survey->list);
 		dl_list_add_tail(&chan->survey_list, &survey->list);
-- 
2.51.1




More information about the Hostap mailing list