hostap: fix Matter over Wi-Fi build warning

Fix the build warning that 'method may be used uninitialized' when
build Matter over Wi-Fi.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
This commit is contained in:
Maochen Wang 2024-10-18 18:53:04 +08:00 committed by Benjamin Cabé
parent 30763cfc4a
commit 9f72e651b5

View file

@ -837,7 +837,7 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
struct wifi_eap_cipher_config cipher_config = {NULL, "DEFAULT:!EXP:!LOW", "CCMP",
"CCMP", "AES-128-CMAC", NULL};
char *method;
char *method = NULL;
char phase1[128] = {0};
char *phase2 = NULL;
unsigned int index;
@ -1075,9 +1075,12 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
goto out;
}
if (!wpa_cli_cmd_v("set_network %d eap %s", resp.network_id, method)) {
if (method != NULL) {
if (!wpa_cli_cmd_v("set_network %d eap %s", resp.network_id,
method)) {
goto out;
}
}
if (params->security == WIFI_SECURITY_TYPE_EAP_PEAP_MSCHAPV2 ||
params->security == WIFI_SECURITY_TYPE_EAP_PEAP_GTC ||