Merge "Add/allow clang-14 warnings."
diff --git a/libc/bionic/malloc_heapprofd.cpp b/libc/bionic/malloc_heapprofd.cpp
index 9c6ccb4..f017ff5 100644
--- a/libc/bionic/malloc_heapprofd.cpp
+++ b/libc/bionic/malloc_heapprofd.cpp
@@ -273,6 +273,11 @@
atomic_store(&gPreviousDefaultDispatchTable, nullptr);
gEphemeralDispatch = *NativeAllocatorDispatch();
}
+ } else if (expected == kEphemeralHookInstalled) {
+ // Nothing to do here. The ephemeral hook was installed, but
+ // MallocInitHeapprofdHook() was never called. Since the ephemeral hook
+ // is already there, no need to reinstall it.
+ return;
} else if (atomic_compare_exchange_strong(&gHeapprofdState, &expected2,
kInstallingEphemeralHook)) {
// if we still have hook installed, we can reuse the previous