From 900adb3c9f0da591261e4a63b9372ef7f362fe1b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 28 Feb 2021 18:42:06 +0200 Subject: [PATCH] FILS: Simplify code paths Use a shared code path for freeing the wpa_ie buffer to avoid unnecessary complexity with a separate return for the non-FILS case. Signed-off-by: Jouni Malinen --- wpa_supplicant/wpa_supplicant.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index e1497e1f5..40068984b 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -3312,13 +3312,11 @@ static void wpas_update_fils_connect_params(struct wpa_supplicant *wpa_s) if (!wpa_ie) return; - if (params.auth_alg != WPA_AUTH_ALG_FILS) { - os_free(wpa_ie); - return; + if (params.auth_alg == WPA_AUTH_ALG_FILS) { + wpa_s->auth_alg = params.auth_alg; + wpa_drv_update_connect_params(wpa_s, ¶ms, mask); } - wpa_s->auth_alg = params.auth_alg; - wpa_drv_update_connect_params(wpa_s, ¶ms, mask); os_free(wpa_ie); } #endif /* CONFIG_FILS && IEEE8021X_EAPOL */