lib/librte_kni/rte_kni.c:224:27-54: WARNING: casting value returned by memory allocation function to (struct rte_kni_memzone_slot *) is useless.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org> --- lib/librte_kni/rte_kni.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 08155db..fd70448 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -221,11 +221,8 @@ rte_kni_init(unsigned int max_kni_ifaces) } /* Allocate slot objects */ - kni_memzone_pool.slots = (struct rte_kni_memzone_slot *) - rte_malloc(NULL, - sizeof(struct rte_kni_memzone_slot) * - max_kni_ifaces, - 0); + kni_memzone_pool.slots = rte_calloc(NULL, max_kni_ifaces, + sizeof(struct rte_kni_memzone_slot), 0); KNI_MEM_CHECK(kni_memzone_pool.slots == NULL); /* Initialize general pool variables */ -- 2.1.4