From: Stephen Hemminger Date: Wed, 20 Nov 2019 23:26:28 +0000 (-0800) Subject: app/testpmd: fix memory leak on detach X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=149677c9a3daddce5f849a991bae5b41010d0c17;p=dpdk.git 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 Acked-by: Bernard Iremonger --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 73ebf37aae..ac1b7b604c 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; }