Merge branch 'contrib/github_pr_11402_v5.1' into 'release/v5.1'

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

See merge request espressif/esp-idf!23840
This commit is contained in:
Aditya Patwardhan 2023-05-19 16:11:15 +08:00
commit d345beb02a

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)
{
/* Give back the semaphore (DS lock) */
xSemaphoreGive(s_ds_lock);
if (xSemaphoreGetMutexHolder(s_ds_lock) == xTaskGetCurrentTaskHandle()) {
/* Give back the semaphore (DS lock) */
xSemaphoreGive(s_ds_lock);
}
}
size_t esp_ds_get_keylen(void *ctx)