From: Stephen Hemminger Date: Tue, 23 Apr 2019 16:53:34 +0000 (-0700) Subject: net/ring: use calloc style where appropriate X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=42a665a3227462c97222f623779a82c8d4f8c54e net/ring: use calloc style where appropriate Use rte_calloc_socket instead of computing size. Fixes: 651c505af862 ("ring: enhance device setup from rings") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 2e4ca3b16a..0355f2b7c4 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -270,15 +270,15 @@ do_eth_dev_ring_create(const char *name, PMD_LOG(INFO, "Creating rings-backed ethdev on numa socket %u", numa_node); - rx_queues_local = rte_zmalloc_socket(name, - sizeof(void *) * nb_rx_queues, 0, numa_node); + rx_queues_local = rte_calloc_socket(name, nb_rx_queues, + sizeof(void *), 0, numa_node); if (rx_queues_local == NULL) { rte_errno = ENOMEM; goto error; } - tx_queues_local = rte_zmalloc_socket(name, - sizeof(void *) * nb_tx_queues, 0, numa_node); + tx_queues_local = rte_calloc_socket(name, nb_tx_queues, + sizeof(void *), 0, numa_node); if (tx_queues_local == NULL) { rte_errno = ENOMEM; goto error;