summaryrefslogtreecommitdiff
path: root/drivers/net/failsafe
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-10-19 04:07:55 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-26 22:14:05 +0200
commite16adf08e54d5b1ff3b1116c372bbca279fced9d (patch)
tree7c837a548bafd12bffa9ef8ee74143243f0af6d7 /drivers/net/failsafe
parentf6a12685a5ff64188b5191f52fd486465e4919db (diff)
downloaddpdk-next-eventdev-e16adf08e54d5b1ff3b1116c372bbca279fced9d.zip
dpdk-next-eventdev-e16adf08e54d5b1ff3b1116c372bbca279fced9d.tar.gz
dpdk-next-eventdev-e16adf08e54d5b1ff3b1116c372bbca279fced9d.tar.xz
ethdev: free all common data when releasing port
This is a clean-up of common ethdev data freeing. All data freeing are moved to rte_eth_dev_release_port() and done only in case of primary process. It is probably fixing some memory leaks for PMDs which were not freeing all data. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'drivers/net/failsafe')
-rw-r--r--drivers/net/failsafe/failsafe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index c3999f0..fed36da 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -280,7 +280,8 @@ free_args:
free_subs:
fs_sub_device_free(dev);
free_dev:
- rte_free(PRIV(dev));
+ /* mac_addrs must not be freed alone because part of dev_private */
+ dev->data->mac_addrs = NULL;
rte_eth_dev_release_port(dev);
return -1;
}
@@ -305,7 +306,8 @@ fs_rte_eth_free(const char *name)
if (ret)
ERROR("Error while destroying hotplug mutex");
rte_free(PRIV(dev)->mcast_addrs);
- rte_free(PRIV(dev));
+ /* mac_addrs must not be freed alone because part of dev_private */
+ dev->data->mac_addrs = NULL;
rte_eth_dev_release_port(dev);
return ret;
}