summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2019-11-20 15:26:28 -0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-11-21 13:55:55 +0000
commit038fd679cabf0bdf300abdd003457c9d3d35efe2 (patch)
treec33ca83ff105f240f9716bc68f771699851326a7
parenta39c4851f80ebd86fadb10b96aaeb27764006d5d (diff)
downloaddpdk-next-net-intel-038fd679cabf0bdf300abdd003457c9d3d35efe2.zip
dpdk-next-net-intel-038fd679cabf0bdf300abdd003457c9d3d35efe2.tar.gz
dpdk-next-net-intel-038fd679cabf0bdf300abdd003457c9d3d35efe2.tar.xz
app/testpmd: fix memory leak in iterator
The RTE_FOREACH_MATCHING_DEV iterator requires that if a break is done before the end of the loop, the function rte_eth_iterator_cleanup() must be called. Fixes: 55e51c962432 ("app/testpmd: add device related commands") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
-rw-r--r--app/test-pmd/testpmd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 73ebf37..ac1b7b6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2619,6 +2619,7 @@ detach_device(char *identifier)
if (ports[port_id].port_status != RTE_PORT_CLOSED) {
if (ports[port_id].port_status != RTE_PORT_STOPPED) {
printf("Port %u not stopped\n", port_id);
+ rte_eth_iterator_cleanup(&iterator);
return;
}