diff --git a/lib/bdev/malloc/blockdev_malloc.c b/lib/bdev/malloc/blockdev_malloc.c index b0cb21eb8..f882494b8 100644 --- a/lib/bdev/malloc/blockdev_malloc.c +++ b/lib/bdev/malloc/blockdev_malloc.c @@ -235,12 +235,14 @@ struct malloc_disk *create_malloc_disk(uint64_t num_blocks, uint32_t block_size) return NULL; } - mdisk = rte_zmalloc(NULL, sizeof(*mdisk), 0); + mdisk = rte_malloc(NULL, sizeof(*mdisk), 0); if (!mdisk) { perror("mdisk"); return NULL; } + memset(mdisk, 0, sizeof(*mdisk)); + /* * Allocate the large backend memory buffer using rte_malloc(), * so that we guarantee it is allocated from hugepage memory. diff --git a/lib/ioat/ioat_impl.h b/lib/ioat/ioat_impl.h index c5c310f55..146fce3e4 100644 --- a/lib/ioat/ioat_impl.h +++ b/lib/ioat/ioat_impl.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -39,8 +40,12 @@ static inline void * ioat_zmalloc(const char *tag, size_t size, unsigned align, uint64_t *phys_addr) { - void *buf = rte_zmalloc(tag, size, align); - *phys_addr = rte_malloc_virt2phy(buf); + void *buf = rte_malloc(tag, size, align); + + if (buf) { + memset(buf, 0, size); + *phys_addr = rte_malloc_virt2phy(buf); + } return buf; }