diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index 885418dac7..9c6c1fced1 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -2124,6 +2124,11 @@ int esp_wifi_wps_enable(const esp_wps_config_t *config) return ESP_ERR_WIFI_MODE; } + if (is_dpp_enabled()) { + wpa_printf(MSG_ERROR, "wps enabled failed since DPP is initialized"); + return ESP_FAIL; + } + API_MUTEX_TAKE(); if (s_wps_enabled) { API_MUTEX_GIVE(); @@ -2177,10 +2182,6 @@ int wifi_wps_enable_internal(const esp_wps_config_t *config) return ESP_ERR_WIFI_WPS_TYPE; } - if (is_dpp_enabled()) { - wpa_printf(MSG_ERROR, "wps enabled failed since DPP is initialized"); - return ESP_FAIL; - } wpa_printf(MSG_DEBUG, "Set factory information."); ret = wps_set_factory_info(config); if (ret != 0) {