From patchwork Fri Oct 8 06:41:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng, ZhihongX" X-Patchwork-Id: 100745 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5AAA6A0C41; Fri, 8 Oct 2021 08:52:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DCDC4067E; Fri, 8 Oct 2021 08:52:07 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 75A8740040; Fri, 8 Oct 2021 08:52:04 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="312645723" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="312645723" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:52:03 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489342889" Received: from unknown (HELO localhost.localdomain) ([10.240.183.65]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:52:01 -0700 From: zhihongx.peng@intel.com To: olivier.matz@6wind.com, dmitry.kozliuk@gmail.com Cc: dev@dpdk.org, Zhihong Peng , stable@dpdk.org Date: Fri, 8 Oct 2021 06:41:30 +0000 Message-Id: <20211008064131.369133-1-zhihongx.peng@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210917021502.502560-2-zhihongx.peng@intel.com> References: <20210917021502.502560-2-zhihongx.peng@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 1/2] lib/cmdline: release cl when cmdline exit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Zhihong Peng Malloc cl in the cmdline_stdin_new function, so release in the cmdline_stdin_exit function is logical, so that cl will not be released alone. Fixes: af75078fece3 (first public release) Cc: stable@dpdk.org Signed-off-by: Zhihong Peng --- doc/guides/rel_notes/release_21_11.rst | 5 +++++ lib/cmdline/cmdline_socket.c | 1 + 2 files changed, 6 insertions(+) diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index efeffe37a0..be24925d16 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -191,6 +191,11 @@ API Changes the crypto/security operation. This field will be used to communicate events such as soft expiry with IPsec in lookaside mode. +* cmdline: The API cmdline_stdin_exit has added cmdline_free function. + Malloc cl in the cmdline_stdin_new function, so release in the + cmdline_stdin_exit function is logical. The application code + that calls cmdline_free needs to be deleted. + ABI Changes ----------- diff --git a/lib/cmdline/cmdline_socket.c b/lib/cmdline/cmdline_socket.c index 998e8ade25..ebd5343754 100644 --- a/lib/cmdline/cmdline_socket.c +++ b/lib/cmdline/cmdline_socket.c @@ -53,4 +53,5 @@ cmdline_stdin_exit(struct cmdline *cl) return; terminal_restore(cl); + cmdline_free(cl); } From patchwork Fri Oct 8 06:41:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng, ZhihongX" X-Patchwork-Id: 100746 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A45CDA0C41; Fri, 8 Oct 2021 08:52:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 450C5410DB; Fri, 8 Oct 2021 08:52:11 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id A490740E28; Fri, 8 Oct 2021 08:52:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="312645734" X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="312645734" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:52:08 -0700 X-IronPort-AV: E=Sophos;i="5.85,356,1624345200"; d="scan'208";a="489342915" Received: from unknown (HELO localhost.localdomain) ([10.240.183.65]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 23:52:06 -0700 From: zhihongx.peng@intel.com To: olivier.matz@6wind.com, dmitry.kozliuk@gmail.com Cc: dev@dpdk.org, Zhihong Peng , stable@dpdk.org Date: Fri, 8 Oct 2021 06:41:31 +0000 Message-Id: <20211008064131.369133-2-zhihongx.peng@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211008064131.369133-1-zhihongx.peng@intel.com> References: <20210917021502.502560-2-zhihongx.peng@intel.com> <20211008064131.369133-1-zhihongx.peng@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 2/2] app/test: delete cmdline free function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Zhihong Peng Cmdline will be released in cmdline_stdin_exit function, so it does not need to be released here. Fixes: acdabc450ea0 (test: fix terminal settings on exit) Cc: stable@dpdk.org Signed-off-by: Zhihong Peng Acked-by: Dmitry Kozlyuk --- app/test/test.c | 1 - app/test/test_cmdline_lib.c | 1 - 2 files changed, 2 deletions(-) diff --git a/app/test/test.c b/app/test/test.c index 173d202e47..5194131026 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -233,7 +233,6 @@ main(int argc, char **argv) cmdline_interact(cl); cmdline_stdin_exit(cl); - cmdline_free(cl); } #endif ret = 0; diff --git a/app/test/test_cmdline_lib.c b/app/test/test_cmdline_lib.c index d5a09b4541..6bcfa6511e 100644 --- a/app/test/test_cmdline_lib.c +++ b/app/test/test_cmdline_lib.c @@ -174,7 +174,6 @@ test_cmdline_socket_fns(void) /* void functions */ cmdline_stdin_exit(NULL); - cmdline_free(cl); return 0; error: printf("Error: function accepted null parameter!\n");