pci: fix memory leak when detaching device
authorYangchao Zhou <zhouyates@gmail.com>
Thu, 29 Sep 2016 01:41:10 +0000 (09:41 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 4 Oct 2016 08:05:51 +0000 (10:05 +0200)
Fixes: dbe6b4b61b0e ("pci: probe or close device")

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: David Marchand <david.marchand@6wind.com>
lib/librte_eal/common/eal_common_pci.c

index 609c424..638cd86 100644 (file)
@@ -387,6 +387,7 @@ rte_eal_pci_detach(const struct rte_pci_addr *addr)
                        goto err_return;
 
                TAILQ_REMOVE(&pci_device_list, dev, next);
+               free(dev);
                return 0;
        }
        return -1;