aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/pool.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vppinfra/pool.h b/src/vppinfra/pool.h
index 62d5b54ec07..14c6a75c13b 100644
--- a/src/vppinfra/pool.h
+++ b/src/vppinfra/pool.h
@@ -233,9 +233,10 @@ do { \
_pool_var (l) = 0; \
if (P) \
{ \
- if (_pool_var (p)->max_elts) \
- return 0; \
- _pool_var (l) = vec_len (_pool_var (p)->free_indices); \
+ if (_pool_var (p)->max_elts) \
+ _pool_var (l) = _pool_var (p)->max_elts; \
+ else \
+ _pool_var (l) = vec_len (_pool_var (p)->free_indices); \
} \
\
/* Free elements, certainly won't expand */ \