> -----Original Message----- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mauricio Vasquez B > Sent: Wednesday, November 18, 2015 10:29 PM > To: dev at dpdk.org > Subject: [dpdk-dev] [PATCH] ring: Fix memory leakage in > rte_pmd_ring_devuninit() > > When freeing the device, it is also necessary to free rx_queues and > tx_queues > > Signed-off-by: Mauricio Vasquez B > <mauricio.vasquezbernal at studenti.polito.it> > --- > drivers/net/ring/rte_eth_ring.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/ring/rte_eth_ring.c > b/drivers/net/ring/rte_eth_ring.c index 9a31bce..e091e4f 100644 > --- a/drivers/net/ring/rte_eth_ring.c > +++ b/drivers/net/ring/rte_eth_ring.c > @@ -582,6 +582,9 @@ rte_pmd_ring_devuninit(const char *name) > return -ENODEV; > > eth_dev_stop(eth_dev); > + > + rte_free(eth_dev->data->rx_queues); > + rte_free(eth_dev->data->tx_queues); > rte_free(eth_dev->data->dev_private); > rte_free(eth_dev->data);
Hi, This should test for eth_dev->data before freeing the members. Like: if (eth_dev->data) { rte_free(eth_dev->data->rx_queues); rte_free(eth_dev->data->tx_queues); rte_free(eth_dev->data->dev_private); } Thanks, John