DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] testpmd: fix memory leak in iterator
@ 2019-11-20 23:26 Stephen Hemminger
  2019-11-21 11:43 ` Iremonger, Bernard
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2019-11-20 23:26 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, ndabilpuram, stable

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: ndabilpuram@marvell.com
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/testpmd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 446da3623442..cf59c378229f 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2616,6 +2616,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;
 			}
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-21 13:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 23:26 [dpdk-dev] [PATCH] testpmd: fix memory leak in iterator Stephen Hemminger
2019-11-21 11:43 ` Iremonger, Bernard
2019-11-21 13:58   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).