]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Fix mesh_external_pmksa_cache initialization to cover error cases
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 25 Feb 2025 20:36:54 +0000 (22:36 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 25 Feb 2025 20:36:54 +0000 (22:36 +0200)
The dl_list needs to be initialized before wpa_supplicant_cleanup() can
be called, e.g., due to an early termination caused by failure to
initialize the interface.

Fixes: 4d77d80edd35 ("mesh: Add MESH_PMKSA_GET/ADD commands")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/wpa_supplicant.c

index e54ad8bea088a92c549b4f79b9f62aa813fb911f..933c971ce0ac17197031466772fda62c24d9555d 100644 (file)
@@ -6312,6 +6312,12 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent)
 #endif /* CONFIG_NO_ROBUST_AV */
        wpa_s->ml_probe_mld_id = -1;
 
+#ifdef CONFIG_PMKSA_CACHE_EXTERNAL
+#ifdef CONFIG_MESH
+       dl_list_init(&wpa_s->mesh_external_pmksa_cache);
+#endif /* CONFIG_MESH */
+#endif /* CONFIG_PMKSA_CACHE_EXTERNAL */
+
        return wpa_s;
 }
 
@@ -7823,12 +7829,6 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
        if (wpa_bss_init(wpa_s) < 0)
                return -1;
 
-#ifdef CONFIG_PMKSA_CACHE_EXTERNAL
-#ifdef CONFIG_MESH
-       dl_list_init(&wpa_s->mesh_external_pmksa_cache);
-#endif /* CONFIG_MESH */
-#endif /* CONFIG_PMKSA_CACHE_EXTERNAL */
-
        /*
         * Set Wake-on-WLAN triggers, if configured.
         * Note: We don't restore/remove the triggers on shutdown (it doesn't