From: John McNamara Date: Fri, 6 Nov 2015 17:28:37 +0000 (+0000) Subject: ring: fix memory freeing on error X-Git-Tag: spdx-start~8102 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4c28fb76855edeb03e5bf736dbbafd12cd84ac63;p=dpdk.git ring: fix memory freeing on error Fix minor memory free issue in error clean-up. Reported-by Coverity (CID 119258) Fixes: 651c505af862 ("ring: enhance device setup from rings") Signed-off-by: John McNamara --- diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index cc60008c91..9a31bcea1f 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -363,8 +363,10 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], return data->port_id; error: - rte_free(data->rx_queues); - rte_free(data->tx_queues); + if (data) { + rte_free(data->rx_queues); + rte_free(data->tx_queues); + } rte_free(data); rte_free(internals);