The mempool local cache was not initialized properly leading to
undefined behavior in cases where the allocated memory was used
previously and left with data.
Fixes:
213af31e0960 ("mempool: reduce structure size if no cache needed")
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
/* init the mempool structure */
mp = mz->addr;
- memset(mp, 0, sizeof(*mp));
+ memset(mp, 0, MEMPOOL_HEADER_SIZE(mp, cache_size));
ret = snprintf(mp->name, sizeof(mp->name), "%s", name);
if (ret < 0 || ret >= (int)sizeof(mp->name)) {
rte_errno = ENAMETOOLONG;