diff --git a/src/ucs/debug/memtrack.c b/src/ucs/debug/memtrack.c index ca6e4858aab3..5bd023cde5a4 100644 --- a/src/ucs/debug/memtrack.c +++ b/src/ucs/debug/memtrack.c @@ -248,8 +248,11 @@ static UCS_F_NOINLINE void ucs_memtrack_do_releasing(void *ptr) iter = kh_get(ucs_memtrack_ptr_hash, &ucs_memtrack_context.ptrs, (uintptr_t)ptr); if (iter == kh_end(&ucs_memtrack_context.ptrs)) { + /* workaround for coverity - print debug message from unlocked + * memtrack */ + pthread_mutex_unlock(&ucs_memtrack_context.lock); ucs_debug("address %p not found in memtrack ptr hash", ptr); - goto out_unlock; + return; } /* remote pointer from hash */ @@ -261,7 +264,6 @@ static UCS_F_NOINLINE void ucs_memtrack_do_releasing(void *ptr) ucs_memtrack_entry_update(entry, -size); ucs_memtrack_entry_update(&ucs_memtrack_context.total, -size); -out_unlock: pthread_mutex_unlock(&ucs_memtrack_context.lock); }