summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-10-18 01:42:52 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-10-19 22:37:10 +0200
commit739e13bcc98f562d3301f808ec76507ebae82e63 (patch)
treed79033142fcc85eb2ff77a9f62b2d1a07e9169ef
parentb5b38ed87893810de02dc63a6c722ef6aa3ff340 (diff)
downloaddpdk-739e13bcc98f562d3301f808ec76507ebae82e63.zip
dpdk-739e13bcc98f562d3301f808ec76507ebae82e63.tar.gz
dpdk-739e13bcc98f562d3301f808ec76507ebae82e63.tar.xz
devargs: fix freeing during device removal
After calling unplug function of a bus, the device is expected to be freed. It is too late for getting devargs to remove. Anyway, the buses which implement unplug are already freeing the devargs, except the PCI bus. So the call to rte_devargs_remove() is removed from EAL and added in PCI. Fixes: 2effa126fbd8 ("devargs: simplify parameters of removal function") Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
-rw-r--r--drivers/bus/pci/pci_common.c1
-rw-r--r--lib/librte_eal/common/eal_common_dev.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index 41f8fc2..feb7980 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -522,6 +522,7 @@ pci_unplug(struct rte_device *dev)
ret = rte_pci_detach_dev(pdev);
if (ret == 0) {
rte_pci_remove_device(pdev);
+ rte_devargs_remove(dev->devargs);
free(pdev);
}
return ret;
diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index 0c873bf..8b0844a 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -372,8 +372,6 @@ local_dev_remove(struct rte_device *dev)
return ret;
}
- rte_devargs_remove(dev->devargs);
-
return 0;
}