]> git.droids-corp.org - dpdk.git/commitdiff
devargs: fix freeing during device removal
authorThomas Monjalon <thomas@monjalon.net>
Wed, 17 Oct 2018 23:42:52 +0000 (01:42 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 19 Oct 2018 20:37:10 +0000 (22:37 +0200)
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>
drivers/bus/pci/pci_common.c
lib/librte_eal/common/eal_common_dev.c

index 41f8fc27eb7f6724a22682684dfb42bbf2205b67..feb79803c116525b0e18205f33e34df8c992575d 100644 (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;
index 0c873bfe0b0e834e6f3caab302571b753de92b22..8b0844af166929546a0005ca21416950b192772d 100644 (file)
@@ -372,8 +372,6 @@ local_dev_remove(struct rte_device *dev)
                return ret;
        }
 
-       rte_devargs_remove(dev->devargs);
-
        return 0;
 }