[dpdk-dev] ring: Fix memory leakage in rte_pmd_ring_devuninit
Commit Message
When freeing the device it is also neccesary to free
rx_queues and tx_queues
Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
---
v2:
Added extra control before freeing members of eth_dev->data
drivers/net/ring/rte_eth_ring.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Comments
2015-11-20 19:24, Mauricio Vasquez B:
> When freeing the device it is also neccesary to free
> rx_queues and tx_queues
>
> Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Applied with spacing fix, thanks
@@ -582,7 +582,12 @@ rte_pmd_ring_devuninit(const char *name)
return -ENODEV;
eth_dev_stop(eth_dev);
- rte_free(eth_dev->data->dev_private);
+
+ 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);
+ }
rte_free(eth_dev->data);
rte_eth_dev_release_port(eth_dev);