aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vppinfra/pmalloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c
index 41309dd1d99..5662a36939e 100644
--- a/src/vppinfra/pmalloc.c
+++ b/src/vppinfra/pmalloc.c
@@ -138,6 +138,9 @@ alloc_chunk_from_page (clib_pmalloc_main_t * pm, clib_pmalloc_page_t * pp,
pp->n_free_chunks = a->subpages_per_page;
}
+ if (pp->n_free_blocks < n_blocks)
+ return 0;
+
alloc_chunk_index = pp->first_chunk_index;
next_chunk: