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-26 18:05:15 +0100
commit149677c9a3daddce5f849a991bae5b41010d0c17 (patch)
tree4db90c1b1a541846b6969d4f3ed8dbd6de55e99f
parenta57fdc78b68dd8e09de02596945f4dd3399f1814 (diff)
downloaddpdk-next-net-intel-149677c9a3daddce5f849a991bae5b41010d0c17.zip
dpdk-next-net-intel-149677c9a3daddce5f849a991bae5b41010d0c17.tar.gz
dpdk-next-net-intel-149677c9a3daddce5f849a991bae5b41010d0c17.tar.xz
app/testpmd: fix memory leak on detach
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;
}