From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9FD34A0C43; Wed, 20 Oct 2021 11:23:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C80240687; Wed, 20 Oct 2021 11:23:00 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 52C1040142 for ; Wed, 20 Oct 2021 11:22:54 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10142"; a="215900820" X-IronPort-AV: E=Sophos;i="5.87,166,1631602800"; d="scan'208";a="215900820" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2021 02:22:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,166,1631602800"; d="scan'208";a="594586284" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP; 20 Oct 2021 02:22:49 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 20 Oct 2021 02:22:49 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 20 Oct 2021 02:22:49 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 20 Oct 2021 02:22:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NVFZa2eX8nWqYwdHdFyDE9DR+TiyDKUm8hpW8hpSeOGAm27LfU+NinrhAJ5Y2vN0t6bkIsayMZnx7GRfem6iPhpoSBXwA3TfM+FmCI+6k6o5dZTm1la1YN48OTVh1M29E7lbdnizbf+lG7GPJwcUaqMAoSyXJ7XptxegaDI61oSnhFBTnPK/SbZXkHAFY2V2sS6zKSCIUtsOJs1wOPmqa7SmiTgIHhS+PhkGKJboHFFCrgThmccRHv6CikqZLg9MhIUWLWEBAoxTA6J5VsASr5H+6e0BVx7A/qrQilKjGuDNz2/PSZiS4XD84ZB0CEnm19JWlTezOf+uJ9EOFPopJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ilfwnyb4QpzTXczXM54usguLKnlbWhd2oncjcSRosiw=; b=IKBogLPM9q4im0+Qlo+iDvsSd2eu9jyGhcqmQaWR5ZYUclOWj2+GDcM96rC7NNtPfKAjG5mJepiNU9JWdqjRsTwC5+4kYp8N3NUxaAqicdkdPkmjELK8JZ/u++wm9nJmnPBoRUYbcyU8VIkY7QU/UYwuz06u9pexED5MCmUcdKkCcguSgbD7pW24s+tmVV3Y1Ex8fvOaiaavVcJPIAdcu5f70hS3e/iM5v3mAalY4a37iDHjCNs7F04FYGti9RR1qMmKBF3fYAI0zps0dyzOVXUZGchLHZbcF6wgIegcHK0sOHSuUgHC8bAPSW+Ssi+RMWdnBgLkR3w91eZ1h24ksA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ilfwnyb4QpzTXczXM54usguLKnlbWhd2oncjcSRosiw=; b=Lhbk1jeAMicJQBsoxMEU6g0Xd7KrFM6443bo/2HFQ3k/nLUV437MMZqB8PFP9Y5XyS7aSqupoprt4LTTRg8l24Eo7eKjx0mPF1vg+7ujzdfVs8LRDgacNeb/k9X0/0Jp3U/h+mQwjt6pYxIPaqKSO1PL7BX6IVRYoh0D2BsfZ7E= Received: from DM8PR11MB5591.namprd11.prod.outlook.com (2603:10b6:8:38::23) by DM8PR11MB5576.namprd11.prod.outlook.com (2603:10b6:8:37::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Wed, 20 Oct 2021 09:22:48 +0000 Received: from DM8PR11MB5591.namprd11.prod.outlook.com ([fe80::3d47:b590:aa2a:d5cc]) by DM8PR11MB5591.namprd11.prod.outlook.com ([fe80::3d47:b590:aa2a:d5cc%9]) with mapi id 15.20.4628.016; Wed, 20 Oct 2021 09:22:48 +0000 From: "Peng, ZhihongX" To: "olivier.matz@6wind.com" , "dmitry.kozliuk@gmail.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v5] lib/cmdline: release cl when cmdline exit Thread-Index: AQHXxChW7hIhVY8pDEi3s7eBajHPuKvbn6+w Date: Wed, 20 Oct 2021 09:22:48 +0000 Message-ID: References: <20211013015223.1155876-2-zhihongx.peng@intel.com> <20211018135850.1348365-1-zhihongx.peng@intel.com> In-Reply-To: <20211018135850.1348365-1-zhihongx.peng@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0c707d3c-5d82-47f2-2684-08d993ab2ec0 x-ms-traffictypediagnostic: DM8PR11MB5576: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OAzYTNSWTIC4HzjoWE+4hjTv0+qJ5jtIxj1Iz80hdzbchRJK/KbURI8MMP0NhIv3WzWaaSFx7JB+hxC4eVy8KMlWbJXS4PPb6mmSk/wHTuzjSn44xm8JTA1pOTHqknQ7I0UFMr4fyD1e+atBFx3BplSYHgX9f11Buna0u5bY9uiCGwWhNHwnMxJJjl+80Rt8bExdntM8q/l0H3HGVvFqgefC+i+cY+AspWc+6AGXW15eTOqnwn/1N8QSJPh119wogO1xzdOX2fSyOwmGxCk/sdgnbpkWUcrnkNMd4s7Z1txfxQTXgoJwPbmZjn2+I+aDrySbFwgLM8RkakifEm43AVF7XSB7qEdIYgnoy/Gq/0qW4ObmyN9EMtqArmFH+nlydP8UZzO7m4znZci6VMHq+gOl6Uv0rVM4lZgdIYHYsQwIfIKNudHjpuQHySlBRA3ONPr7FmgS74DT4AaShqFD2fBFCwilK2bRo9kDQxyzVxiXyRmFE8Bu3JiS5igTFrcJy+CkNMPFlyNcXX43eJw3mKfTTU5N7sYUKDnbgQVZPyXhe9ov78EzbFGs7BGwXKsu75reDaUmNdtgizZavakOEhUGDBhANZzjJNBskfC280uNkRXicjKdL4RU5DWamgeZuqqVCddArD0VUpux1Ry9uj23o46j5DqHzVjecbELHhuhZDyP20qSiGyvjXJFWdEG3/izw7O7SMKEk1WGoJzcFA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5591.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(83380400001)(82960400001)(8936002)(5660300002)(8676002)(110136005)(508600001)(2906002)(38100700002)(33656002)(122000001)(26005)(71200400001)(52536014)(186003)(7696005)(6506007)(4326008)(316002)(55016002)(38070700005)(53546011)(66946007)(66476007)(64756008)(9686003)(76116006)(66446008)(66556008)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DWEzCyUDVAu0LOPr8Ut4+1rW1KA5aKoLLJVmhVKsfNLc5NEzJpgpq5PWFMFi?= =?us-ascii?Q?3JocbnT5PmitoKT0Mlmrh9Eh0pbHVnvlbuLre4T1tdlgssAMyGiAySgzx8ck?= =?us-ascii?Q?UpaXJ/RYGnVf54qPaBWURgS18VQOInLkMotX2z3JCGx+RfmkCF3nhyAByDom?= =?us-ascii?Q?OBlDmsDq5/DlmhRTWPedkQHasxsdh93APjnZkMzUiWzQzvcnCCw0i543i8uo?= =?us-ascii?Q?445R5SuhYie29T7n1aEfTCBk0Ub1IZH69c3MckZkirAW2S6qluIb92sKJWVz?= =?us-ascii?Q?ImsFmQWk7iT4MQ/Km04PggmzGt3hihof5S4zVBS8aLFFEYfO7IfwDI9VbTMr?= =?us-ascii?Q?VZaXYPQDjyn3fLUMZR5eX2jDZ0wdLn3tNsJjc14E1aNvZdthQd1Y4mnFwBfi?= =?us-ascii?Q?jJ6+oVHzjl5nsrKSB2p4dua1zPVsNXSl4D3SmEK4RfhLx0T6TDaXcIQi4pkv?= =?us-ascii?Q?QQtwDYr6jOSNgJf8zg4yYM1HvsBa28GoI9HJVfgxxVHFDnpUIb3g9w1C9uAz?= =?us-ascii?Q?nMBA9ZwwnKt3/X0hlW0QCJd7aKgSbkPHSrjmejA49DORv4OQCOdKYsXqzOfV?= =?us-ascii?Q?Dezv1BKisxM5RnRg5xzTOahPNh3FHNI1fY7Jg0q3JINSkZVFgrIMWnlahWFa?= =?us-ascii?Q?B4hXp4n84LOmpDx+qukvitc6XfiocsfJzA3clCfQB3QXJ8zuwqzSP8LRWJPb?= =?us-ascii?Q?lBRIgYNOrukZwuCEF4Bd9Sdk5cwHcOdl2BBbnl0kWa+bDrw6946Ygl4ymb/u?= =?us-ascii?Q?6cAyWmj/kkdisjxITZ+Fg+zneR9Rz/RC/rzaCV4C+WTeJToIf8hffCMURKGL?= =?us-ascii?Q?OgveD/kloAP+l5QL/BgDUFyphfOYhhyDrMYAhhAjWPTHFH3cALEfj9IDccGc?= =?us-ascii?Q?ytBOSzpP4lN3oZF+TjI+y0Jikd+xK/NhCDwcuB17T6rNegUb4BR6wthm8KtG?= =?us-ascii?Q?pTKeKv9vjZqKLSKyu1lM3Kq5vZc28mTtcqj/RHqY1FWaTLqYb+UX8oDe8EMc?= =?us-ascii?Q?iSkfJs9bXiVcS6fQBGN1bhDXXxOmmKtfOcABAb2abmw7hUOgWQU+w9/Yn/C8?= =?us-ascii?Q?5/6SOY5WK41Z4OnC5gMOv9kswM1BMJnXdU5H+mac77xrNEiXwXxJGKYf7Wzh?= =?us-ascii?Q?pz6KDVAQr/WX179WC3StdZPPVE/ozwMN0xdef3XTGXteTPRbKQ3IdxuqJ+7M?= =?us-ascii?Q?vWyiiX8edjqa+nxl30S6vAIFJMXe4/sjpfyrFCXTgQHpbBErGwy926MN+kG4?= =?us-ascii?Q?bqBxWLgBKEwowmymcEQQbY1249353/xre5cSFgItqGVhirVqFUFySZpnsxEu?= =?us-ascii?Q?MMnohYH+RyHkvlm5ShwqwkA6?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5591.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c707d3c-5d82-47f2-2684-08d993ab2ec0 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2021 09:22:48.1526 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zhihongx.peng@intel.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5576 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5] 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" > -----Original Message----- > From: Peng, ZhihongX > Sent: Monday, October 18, 2021 9:59 PM > To: olivier.matz@6wind.com; dmitry.kozliuk@gmail.com > Cc: dev@dpdk.org; Peng, ZhihongX > Subject: [PATCH v5] lib/cmdline: release cl when cmdline exit >=20 > From: Zhihong Peng >=20 > 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 a= lone. >=20 > Fixes: af75078fece3 ("first public release") > Cc: intel.com >=20 > Signed-off-by: Zhihong Peng > --- > app/test/test.c | 1 - > app/test/test_cmdline_lib.c | 1 - > doc/guides/rel_notes/release_21_11.rst | 3 +++ > lib/cmdline/cmdline_socket.c | 1 + > 4 files changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/app/test/test.c b/app/test/test.c index 173d202e47..51941310= 26 > 100644 > --- a/app/test/test.c > +++ b/app/test/test.c > @@ -233,7 +233,6 @@ main(int argc, char **argv) >=20 > cmdline_interact(cl); > cmdline_stdin_exit(cl); > - cmdline_free(cl); > } > #endif > ret =3D 0; > diff --git a/app/test/test_cmdline_lib.c b/app/test/test_cmdline_lib.c in= dex > 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); >=20 > - cmdline_free(cl); > return 0; > error: > printf("Error: function accepted null parameter!\n"); diff --git > a/doc/guides/rel_notes/release_21_11.rst > b/doc/guides/rel_notes/release_21_11.rst > index d5435a64aa..6aa98d1e34 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -237,6 +237,9 @@ API Changes > the crypto/security operation. This field will be used to communicate > events such as soft expiry with IPsec in lookaside mode. >=20 > +* cmdline: ``cmdline_stdin_exit()`` now frees the ``cmdline`` structure. > + Calls to ``cmdline_free()`` after it need to be deleted from applicati= ons. > + >=20 > 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; >=20 > terminal_restore(cl); > + cmdline_free(cl); > } > -- > 2.25.1 Tested-by: Zhihong Peng