Merge branch 'contrib/github_pr_11402' into 'master'

esp_ds: ignore releasing mutex if not called from same task (GitHub PR)

Closes IDFGH-10131

See merge request espressif/esp-idf!23763
This commit is contained in:
Mahavir Jain
2023-05-19 10:59:33 +08:00

View File

@@ -94,8 +94,10 @@ esp_err_t esp_ds_init_data_ctx(esp_ds_data_ctx_t *ds_data)
void esp_ds_release_ds_lock(void) void esp_ds_release_ds_lock(void)
{ {
/* Give back the semaphore (DS lock) */ if (xSemaphoreGetMutexHolder(s_ds_lock) == xTaskGetCurrentTaskHandle()) {
xSemaphoreGive(s_ds_lock); /* Give back the semaphore (DS lock) */
xSemaphoreGive(s_ds_lock);
}
} }
size_t esp_ds_get_keylen(void *ctx) size_t esp_ds_get_keylen(void *ctx)