Skip to content

Commit 9f72e65

Browse files
MaochenWang1kartben
authored andcommitted
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 <[email protected]>
1 parent 30763cf commit 9f72e65

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

modules/hostap/src/supp_api.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
837837
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
838838
struct wifi_eap_cipher_config cipher_config = {NULL, "DEFAULT:!EXP:!LOW", "CCMP",
839839
"CCMP", "AES-128-CMAC", NULL};
840-
char *method;
840+
char *method = NULL;
841841
char phase1[128] = {0};
842842
char *phase2 = NULL;
843843
unsigned int index;
@@ -1075,8 +1075,11 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
10751075
goto out;
10761076
}
10771077

1078-
if (!wpa_cli_cmd_v("set_network %d eap %s", resp.network_id, method)) {
1079-
goto out;
1078+
if (method != NULL) {
1079+
if (!wpa_cli_cmd_v("set_network %d eap %s", resp.network_id,
1080+
method)) {
1081+
goto out;
1082+
}
10801083
}
10811084

10821085
if (params->security == WIFI_SECURITY_TYPE_EAP_PEAP_MSCHAPV2 ||

0 commit comments

Comments
 (0)