From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 24D13A034E;
	Thu, 24 Feb 2022 13:52:32 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B033141155;
	Thu, 24 Feb 2022 13:52:31 +0100 (CET)
Received: from smtp.tom.com (smtprz14.163.net [106.3.154.247])
 by mails.dpdk.org (Postfix) with ESMTP id 5CB5A4114D
 for <dev@dpdk.org>; Thu, 24 Feb 2022 13:52:30 +0100 (CET)
Received: from my-app01.tom.com (my-app01.tom.com [127.0.0.1])
 by freemail01.tom.com (Postfix) with ESMTP id 32FAC1E8C1E0
 for <dev@dpdk.org>; Thu, 24 Feb 2022 20:52:29 +0800 (CST)
Received: from my-app01.tom.com (HELO smtp.tom.com) ([127.0.0.1])
 by my-app01 (TOM SMTP Server) with SMTP ID 462400464
 for <dev@dpdk.org>; Thu, 24 Feb 2022 20:52:29 +0800 (CST)
Received: from antispam3.tom.com (unknown [172.25.16.54])
 by freemail01.tom.com (Postfix) with ESMTP id 1B8FB1E8C1DE
 for <dev@dpdk.org>; Thu, 24 Feb 2022 20:52:28 +0800 (CST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tom.com; s=201807;
 t=1645707149; bh=VR6FITNqvpkkTsr6DyeYMJ4GDojI56WJ4R+p3hevow8=;
 h=From:To:Subject:Date:From;
 b=j4JmtgF+renLed+/h7uXot79EE8ZSmafITDac9N2DOzHZzRjJKJRijTK73UE8NIjN
 eyVcwVXbXwG9apoAoO8UXvqrDn7TeOFk2pKdXeSDEF/VdGb3R9dg9qqXChRtHnAnNB
 CRQnV2eow2kftl/Nim9CneO/ps9wFelCbdsH2JQ8=
Received: from antispam3.tom.com (antispam3.tom.com [127.0.0.1])
 by antispam3.tom.com (Postfix) with ESMTP id D96519C1A75
 for <dev@dpdk.org>; Thu, 24 Feb 2022 20:52:28 +0800 (CST)
X-Virus-Scanned: Debian amavisd-new at antispam3.tom.com
Received: from antispam3.tom.com ([127.0.0.1])
 by antispam3.tom.com (antispam3.tom.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id NQgoe6aWeJQI for <dev@dpdk.org>;
 Thu, 24 Feb 2022 20:52:28 +0800 (CST)
Received: from haizhi-vm.localdomain (unknown [113.88.15.206])
 by antispam3.tom.com (Postfix) with ESMTPA id F18969C1A35
 for <dev@dpdk.org>; Thu, 24 Feb 2022 20:52:25 +0800 (CST)
From: Tianli Lai <laitianli@tom.com>
To: dev@dpdk.org
Subject: [PATCH] app/pdump: free mempool at cleanup resources
Date: Thu, 24 Feb 2022 20:52:17 +0800
Message-Id: <1645707137-53479-1-git-send-email-laitianli@tom.com>
X-Mailer: git-send-email 1.8.3.1
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

the mempool should be free when cleanup resources.

Signed-off-by: Tianli Lai <laitianli@tom.com>
---
 app/pdump/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/pdump/main.c b/app/pdump/main.c
index 04a38e8..9c77fc6 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -507,6 +507,10 @@ struct parse_val {
 		/* free the rings */
 		rte_ring_free(pt->rx_ring);
 		rte_ring_free(pt->tx_ring);
+		if (pt->mp) {
+			rte_mempool_free(pt->mp);
+			pt->mp = NULL;
+		}
 	}
 }
 
-- 
1.8.3.1