[dpdk-dev] pci: fix resource leak when detach pci device

Message ID CABLiTuwb4qNxYtC_jmAfcXzDsuG03O8MzYxA3e_DjrdEk4gyhg@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Matt Aug. 6, 2016, 10:52 a.m. UTC
  From be6a6cc831d2b9e26c53ec6014138c3e3d5bffc1 Mon Sep 17 00:00:00 2001
From: zhouyangchao <zhouyates@gmail.com>
Date: Sat, 6 Aug 2016 17:45:51 +0800
Subject: [PATCH] pci: fix resource leak when detach pci device

Signed-off-by: zhouyangchao <zhouyates@gmail.com>
---
 lib/librte_eal/common/eal_common_pci.c | 1 +
 1 file changed, 1 insertion(+)

--
  

Patch

diff --git a/lib/librte_eal/common/eal_common_pci.c
b/lib/librte_eal/common/eal_common_pci.c
index 40f4922..ef6b1c3 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -362,6 +362,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;