summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-11-13 17:44:51 -0800
committerDave Wallace <dwallacelf@gmail.com>2017-11-14 16:53:31 +0000
commit87bd96aa4ddf2f777f8b972062c205e27addbc4a (patch)
treecff351a450a955775254f0572d645d92155bb54e /src
parent88fd504d79ba23d319434e2aa070087a71914165 (diff)
vppinfra: fix pool_get_aligned_will_expand for fixed pools
Change-Id: Ia66ac0a2fa23a3d29370b54e2014900838a8d3ac Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-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 */ \