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: 2effa126fb ("devargs: simplify parameters of removal function")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
This commit is contained in:
Thomas Monjalon 2018-10-18 01:42:52 +02:00
parent b5b38ed878
commit 739e13bcc9
2 changed files with 1 additions and 2 deletions

View File

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

View File

@ -372,8 +372,6 @@ local_dev_remove(struct rte_device *dev)
return ret;
}
rte_devargs_remove(dev->devargs);
return 0;
}