bugfix: fix wrong lock in sleep retention entry destroy

This commit is contained in:
wuzhenghui
2023-03-07 20:55:54 +08:00
parent ffcec33057
commit 43bf9fd3ab

View File

@@ -182,7 +182,6 @@ static void sleep_retention_entries_stats(void)
#if REGDMA_LINK_DBG #if REGDMA_LINK_DBG
void sleep_retention_entries_show_memories(void) void sleep_retention_entries_show_memories(void)
{ {
if (&s_retention.lock) {
_lock_acquire_recursive(&s_retention.lock); _lock_acquire_recursive(&s_retention.lock);
if (s_retention.highpri >= SLEEP_RETENTION_REGDMA_LINK_HIGHEST_PRIORITY && s_retention.highpri <= SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY) { if (s_retention.highpri >= SLEEP_RETENTION_REGDMA_LINK_HIGHEST_PRIORITY && s_retention.highpri <= SLEEP_RETENTION_REGDMA_LINK_LOWEST_PRIORITY) {
for (int entry = 0; entry < ARRAY_SIZE(s_retention.lists[s_retention.highpri].entries); entry++) { for (int entry = 0; entry < ARRAY_SIZE(s_retention.lists[s_retention.highpri].entries); entry++) {
@@ -191,7 +190,6 @@ void sleep_retention_entries_show_memories(void)
} }
} }
_lock_release_recursive(&s_retention.lock); _lock_release_recursive(&s_retention.lock);
}
} }
#endif #endif
@@ -343,7 +341,7 @@ void sleep_retention_entries_destroy(int module)
s_retention.lock = NULL; s_retention.lock = NULL;
return; return;
} }
_lock_acquire_recursive(&s_retention.lock); _lock_release_recursive(&s_retention.lock);
} }
static esp_err_t sleep_retention_entries_create_impl(const sleep_retention_entries_config_t retent[], int num, regdma_link_priority_t priority, int module) static esp_err_t sleep_retention_entries_create_impl(const sleep_retention_entries_config_t retent[], int num, regdma_link_priority_t priority, int module)