BUG/MINOR: pools: maintain consistent ->allocated count on alloc failures
When running with CONFIG_HAP_NO_GLOBAL_POOLS, it's theoritically possible
to keep an incorrect count of allocated entries in a pool because the
allocated counter was used as a cumulated counter of alloc calls instead
of a number of currently allocated items (it's possible the meaning has
changed over time). The only impact in this mode essentially is that
"show pools" will report incorrect values. But this would only happen on
limited pools, which is not even certain still exist.
This was added by recent commit 0bae07592 ("MEDIUM: pools: add
CONFIG_HAP_NO_GLOBAL_POOLS and CONFIG_HAP_GLOBAL_POOLS") so no backport
is needed.
diff --git a/src/pool.c b/src/pool.c
index 3bcecd6..0227f36 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -181,7 +181,6 @@
void *ptr = NULL;
if (limit && allocated >= limit) {
- _HA_ATOMIC_INC(&pool->allocated);
activity[tid].pool_fail++;
return NULL;
}