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 <john.mcnamara@intel.com>
This commit is contained in:
John McNamara 2015-11-06 17:28:37 +00:00 committed by Thomas Monjalon
parent f03924c32e
commit 4c28fb7685

View File

@ -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);