wpa_supplicant: Correct task deletion for RRM and DPP tasks

Closes https://github.com/espressif/esp-idf/issues/7409
This commit is contained in:
Kapil Gupta
2021-08-25 12:55:29 +05:30
parent ab3f183f1c
commit 69e404e7b8
2 changed files with 43 additions and 15 deletions

View File

@@ -34,22 +34,36 @@ struct action_rx_param {
static int esp_dpp_post_evt(uint32_t evt_id, uint32_t data)
{
DPP_API_LOCK();
dpp_event_t *evt = os_zalloc(sizeof(dpp_event_t));
int ret = ESP_OK;
if (evt == NULL) {
DPP_API_UNLOCK();
return ESP_ERR_NO_MEM;
ret = ESP_ERR_NO_MEM;
goto end;
}
evt->id = evt_id;
evt->data = data;
if ( xQueueSend(s_dpp_evt_queue, &evt, 10 / portTICK_PERIOD_MS ) != pdPASS) {
DPP_API_UNLOCK();
os_free(evt);
return ESP_ERR_DPP_FAILURE;
if (s_dpp_api_lock) {
DPP_API_LOCK();
} else {
ret = ESP_ERR_DPP_FAILURE;
goto end;
}
DPP_API_UNLOCK();
return ESP_OK;
if (xQueueSend(s_dpp_evt_queue, &evt, 10 / portTICK_PERIOD_MS ) != pdPASS) {
DPP_API_UNLOCK();
ret = ESP_ERR_DPP_FAILURE;
goto end;
}
if (evt_id != SIG_DPP_DEL_TASK) {
DPP_API_UNLOCK();
}
return ret;
end:
if (evt) {
os_free(evt);
}
return ret;
}
static void esp_dpp_call_cb(esp_supp_dpp_event_t evt, void *data)
@@ -653,6 +667,10 @@ void esp_supp_dpp_deinit(void)
params->key = NULL;
}
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_ACTION_TX_STATUS,
&offchan_event_handler);
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_ROC_DONE,
&offchan_event_handler);
s_dpp_auth_retries = 0;
dpp_global_deinit(s_dpp_ctx.dpp_global);
esp_dpp_post_evt(SIG_DPP_DEL_TASK, 0);