Elements with 2^8B size should fall into index 1 of the list.
Fixes: f62f4a375ff4 ("malloc: optimize 4K allocations")
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Ruifeng Wang <[email protected]>
---
lib/eal/common/malloc_elem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index 35a2313d04..619c040aa3 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -382,7 +382,7 @@ malloc_elem_free_list_index(size_t size)
size_t log2;
size_t index;
- if (size <= (1UL << MALLOC_MINSIZE_LOG2))
+ if (size < (1UL << MALLOC_MINSIZE_LOG2))
return 0;
/* Find next power of 2 > size. */
--
2.25.1