From: Alexander Matushevsky Date: Tue, 4 Jul 2017 13:51:53 +0000 (+0200) Subject: net/ena/base: initialize memory in the allocation macros X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2861ea8df0173f047efe2636ef3b9643d4d989bc;p=dpdk.git net/ena/base: initialize memory in the allocation macros Uninitialized memory could cause memory corruption, by indicating completion of the invalid mbuf. Fixes: 3d3edc265fc8 ("net/ena: make coherent memory allocation NUMA-aware") Cc: stable@dpdk.org Signed-off-by: Alexander Matushevsky Signed-off-by: Michal Krawczyk --- diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 7eaebf40f4..71a8c1e220 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -207,6 +207,7 @@ typedef uint64_t dma_addr_t; snprintf(z_name, sizeof(z_name), \ "ena_alloc_%d", ena_alloc_cnt++); \ mz = rte_memzone_reserve(z_name, size, node, 0); \ + memset(mz->addr, 0, size); \ virt = mz->addr; \ phys = mz->phys_addr; \ } while (0) @@ -219,6 +220,7 @@ typedef uint64_t dma_addr_t; snprintf(z_name, sizeof(z_name), \ "ena_alloc_%d", ena_alloc_cnt++); \ mz = rte_memzone_reserve(z_name, size, node, 0); \ + memset(mz->addr, 0, size); \ virt = mz->addr; \ } while (0)