esp_ds: ignore releasing mutex if not called from same task

This commit is contained in:
Christoph Baechler 2023-05-15 15:02:38 +02:00 committed by Mahavir Jain
parent 3897faa9c8
commit 0002b59fc6
No known key found for this signature in database
GPG Key ID: 99324EF4A00734E0

View File

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