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

Benjamin Berg benjamin at sipsolutions.net
Fri Oct 17 07:05:03 PDT 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 769d8f32c5..2ed01aa1e2 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -2236,6 +2236,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.0




More information about the Hostap mailing list