From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4B5DBA04C7; Thu, 21 Nov 2019 00:26:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E8A0BB62; Thu, 21 Nov 2019 00:26:39 +0100 (CET) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 32249235 for ; Thu, 21 Nov 2019 00:26:38 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id h27so548920pgn.0 for ; Wed, 20 Nov 2019 15:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rwiKK2O456RLbNZ0EuCVo9bMXUgcnSomxhvCaW/Riug=; b=0KpNUxCDri4o26Up/UwUxNo+aQqxceCvoPRCAg0tj9YY09hr4zAcZWr3kouHOO9ydy nQHx3B/Uz+p5DDiitq4v7nQVp0y6HHoYyWgXAc/qY5W6tqQW5vSXu6OmkHJlyx4EP28K T37VwwOBZBVVgtwqxfY4XDlYKb2Y0JRQK3Vm4zv3kC1dQXxrL0/Buvo65xE5WxHucY9H vPW5dUvFK2VceUfUHUURvGXwFrs43zDJvtOf/NOm6eeKAYHw8nqJId/I+d5iOCDbO0nb 6/bDX6JKUuI13VLrDa711ZrwOoW7FIOs0tN0UVOBbzZT5g5mv1Aqzc7MXyqCTwehPIyY cmQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rwiKK2O456RLbNZ0EuCVo9bMXUgcnSomxhvCaW/Riug=; b=q5PzTAx15i5RnVRmVcxO66ukHy7Qxj6vLtJe9v7IZx76K9jQiwLaRxjWzMWwt5rig0 DhtMs1G0SX6b3dHJ9v6mKq/3eFb4Jj00H9kniCjWBm4kAbGcD7cOLRwuSQSSkcOcJj2I CAH15XY4oUTS2TzaLnlPUvV1ilVIOPMJ3LyXIZLDUteo0Dvh/BuQ5OCCe2LD4LRTVfSR A+QHFhTW7n3zOxuyMmpeu3Yy8w9HZgBB3T8srXEo7HEXyLalv36BUu9D3VzJ2M7ZUDYw FZ5CxJXTZcekHvGXpu/46acloO4s7oqFqzA76pvqdJaJSWTUqlQ4CwFvdYc7jFFMeBek CejQ== X-Gm-Message-State: APjAAAU+l2EraEK/l8oCp1Q6TOwX3BkUqbbs4dVMt2cH/Dn8DLJDVKjB O18+PGWjWcbAFPhGdLbBlcZgVppEV5WORA== X-Google-Smtp-Source: APXvYqyQnRrpjm2Ce2taCN2OZh7aBgrI7FK11cb3jVz6YcNoiJfCdIjllxZCkJqnRB1SjJlHuxCa1A== X-Received: by 2002:a63:68c3:: with SMTP id d186mr5453706pgc.301.1574292396714; Wed, 20 Nov 2019 15:26:36 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id w10sm305557pgi.47.2019.11.20.15.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 15:26:35 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , ndabilpuram@marvell.com, stable@dpdk.org Date: Wed, 20 Nov 2019 15:26:28 -0800 Message-Id: <20191120232628.29737-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] testpmd: fix memory leak in iterator X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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