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 A953CA04DD; Tue, 20 Oct 2020 22:24:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE1C4AC6E; Tue, 20 Oct 2020 22:24:35 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 18EBCAC6D; Tue, 20 Oct 2020 22:24:32 +0200 (CEST) IronPort-SDR: av6EqlvcQn6o7wVY+VQmaYsFp0kz5+k7bZC74OvcwPipCRkHQ8mx8ZievBzdzpjrYyAFQfbgho JI9aR/C1tShQ== X-IronPort-AV: E=McAfee;i="6000,8403,9780"; a="184919079" X-IronPort-AV: E=Sophos;i="5.77,398,1596524400"; d="scan'208";a="184919079" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 13:24:31 -0700 IronPort-SDR: oMJp0YuVTR2qAQIExn+wHdWoyXJz/rokvV+FtoPYb1MEcYHvz6lyCgEB/3Hwj4CLjbhkD7foee LgEXa7hRfdSw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,398,1596524400"; d="scan'208";a="348008351" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 20 Oct 2020 13:24:31 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 20 Oct 2020 13:24:30 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 20 Oct 2020 13:24:30 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 20 Oct 2020 13:24:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NjdmHh6T/YvwIB4jGmpOPMBs7reOptg5NCLtL0lzc2m47WjWgKCvOPjR8HiVFnoqKmFXVuGUiLTWL/QJZeHIGEjJA5fnU5LD2Eo4QzRFuSdSLhS96vD78h6+d8VWNYwLPEqQcJIl6bX1eUOw4M0H4wfjlX5Q7ROcF3t/5ic9S3fUlQ3RcDGVOGKJ1sX6d1oMm70IEBfOowlZJj2R2CxR9WWgNLfY7m0ZYUsk8ZN5mskTQvORHffwnIElENn+s5rcWaGMGl3Ygf8e5abL7WgKOijjqsCSi3Oxc82Pjd1Xl8/Y7hk/n9JKiICohu7YEPS4M14uZV0nbsV/3kGq7CR2vg== 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-SenderADCheck; bh=TnK8g0uzJ0v/0JnTYZFf7LBnKvUwoAJQX+LaVagnVcM=; b=Wi3aU6iP4t3xQ3Ub7ylgi0SiEIz+93DLFaNOLJ3tPkcr3rt9ohqFeo99hf3ObQMV8aVLjypXMfqOEpb8qbAgx/ZMe/fE9NwlOdtxp/jQmMeNtDh1Ez3xH7DDqoAX2/Xe4BbpxamF3fifqG3eA6wS4tfvqHrEKW0w+ZimU7CmasTwxzdcbdfp71n9X+bc/rXtxutcbWoVDzrhA3nAuU8+8dW3ecthmbog9mpBe/pwEjBy93C2cQTg+8gnt45d71dUYEE3vNNK+MEK7lK6eGlr9Zv1Xw68P7hjEgeYtmk8uam9lEV5n+DpJ69y1CUxNVgsaZ8IV6Qz9S9INwsRmdsZGA== 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=TnK8g0uzJ0v/0JnTYZFf7LBnKvUwoAJQX+LaVagnVcM=; b=kcj6gD0Fnk39DNmgf7EmUkP5IM7rMzOJVoslprGJrbJlkm9KwNXXVgPPJLJqyT//VDdM9zDn2CSd7Z0OqlOIuxBTmxZceBFxaaAT+L3N1OCyRyqTOgfkKD/KtbHzlJeteovbtNbKlSb2NRcGoZyyjzc5+c/SLgr2hVQ2QTAyKWY= Received: from BYAPR11MB3494.namprd11.prod.outlook.com (2603:10b6:a03:86::15) by BYAPR11MB2661.namprd11.prod.outlook.com (2603:10b6:a02:c5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Tue, 20 Oct 2020 20:24:29 +0000 Received: from BYAPR11MB3494.namprd11.prod.outlook.com ([fe80::5886:71de:a26f:8060]) by BYAPR11MB3494.namprd11.prod.outlook.com ([fe80::5886:71de:a26f:8060%4]) with mapi id 15.20.3477.028; Tue, 20 Oct 2020 20:24:29 +0000 From: "Wang, Yipeng1" To: Thomas Monjalon , "Marohn, Byron" CC: "dev@dpdk.org" , "jerry.lilijun@huawei.com" , "xudingke@huawei.com" , Yunjian Wang , "stable@dpdk.org" , wangyunjian Thread-Topic: [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path Thread-Index: AQHWpurXAa2nmHWNV0OOT+VXTVoqeamg77YQ Date: Tue, 20 Oct 2020 20:24:28 +0000 Message-ID: References: <49d4bdc58b81564788cfd31f16ef2e66c1673f6d.1601347917.git.wangyunjian@huawei.com> <2570421.hXoGziszdc@thomas> In-Reply-To: <2570421.hXoGziszdc@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=intel.com; x-originating-ip: [108.161.24.24] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8d28ae23-8e23-4caa-fde9-08d875362589 x-ms-traffictypediagnostic: BYAPR11MB2661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ta/CeHUFOoTVdPD9MqA9hymwjkgax07ynzfbZJNnPwa7k0gooelsM2TGqvOT7UhzywtJT452aau4HexvPD5vWuunZLaOhhRrySLaNjcEk9M0zNMfw4f3mR3PELTmP0ZypXuKzd09Xzo/GqFkhyK33g/Q9poByfwWz//TL0fCGiqx3gSDGHwOT6LPBwtETNY+L3O5T3mJPCVT9eZs0hIb2kSs8YOlrRsJhEYHmZj+Qdftq2dLWDF7H5+Kwki0vSni84GSxFLViHofypsgXsectwZJ1gf/M4l1rsqEuQ+rKFku9J2CbF5JGFR4UGzCh7oJBzWuGk2ke9P5D0KVB/ljfg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3494.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(376002)(39860400002)(396003)(136003)(4326008)(83380400001)(33656002)(55016002)(8676002)(5660300002)(52536014)(9686003)(86362001)(71200400001)(2906002)(64756008)(66476007)(478600001)(66556008)(26005)(53546011)(66946007)(76116006)(186003)(54906003)(110136005)(66446008)(8936002)(7696005)(6506007)(6636002)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: FmFwTBOX/GuGfj5b/OWbjYc4bkrF5GTdotcE75B/iCjPrGwQBBGp+DQwjt5+W9RckXw+lFS8ov+J6LcmHHHpdrIH6bDeHVTok5rHEz9j9Z3LmkHxbZ3hNqCeuED5wywQF7RE7CSwON0uQT1droYg2CInTo48VVEJBtMvAwhx/EtwxnRaqru0iYYhFp0TCQ+YFDkerJsZT/+gCmM0kjMvp8mrEkONHi0Mf4iog+TWX56M3GFVtUJOunQREzH/ghBi4l8g6LaZ4QVP9YCLBAz79c2G+gPWJ1zbzG436pvPDq3F/219CSzlohhfIjO+TtLKPM5tUP6RS1GNfDF4vUdfoQAzQE4YNigVAomXDomnDcyCg7ane9VdbHs8o7PLouuXQO3ySqkwZ07GkVwFJH+4JiGZAYucajaVmaNJjqhAfTjyQScA2DyLuLf78I5/5kwmZwq9KfpoUIPJZiUJg/nqm394TGgKHRAXYdFDRovwYLBlys9qQVKzY4IraXr7cDSsYyyUhRHEB3k9jD39r8QRpMd7gysr3K/4B1/3mepJlqiJcMhqbc/fbr2zaIeOKKN3qokpvXtkmVve2anOTg0w9cWWj+GozUcV3m9bJh4vgq1/aXzvZiz0uC+GuFAHG5aO2IuQ86AQUuEV1vr1b0HjCQ== 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: BYAPR11MB3494.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d28ae23-8e23-4caa-fde9-08d875362589 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2020 20:24:29.0070 (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: a3SlEQnzS6W1T6UiyUcMqaUZi++xGNy6604hlxcPFwtTK7DanmbdW1pDW7JaW0C7NIQvekBifIjtxzJup0xChA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2661 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path 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" > -----Original Message----- > From: Thomas Monjalon > Sent: Tuesday, October 20, 2020 7:11 AM > To: Marohn, Byron ; Wang, Yipeng1 > > Cc: dev@dpdk.org; jerry.lilijun@huawei.com; xudingke@huawei.com; Yunjian > Wang ; stable@dpdk.org; wangyunjian > > Subject: Re: [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path >=20 > Byron, Yipeng, > Please could you review? > Thanks >=20 > 29/09/2020 05:31, wangyunjian: > > From: Yunjian Wang > > > > In rte_efd_create() allocated memory for tailq entry, we should free > > it when error happens, otherwise it will lead to memory leak. > > > > Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") > > Cc: stable@dpdk.org > > > > Signed-off-by: Yunjian Wang > > --- > > lib/librte_efd/rte_efd.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index > > 6a799556d..0aa120f48 100644 > > --- a/lib/librte_efd/rte_efd.c > > +++ b/lib/librte_efd/rte_efd.c > > @@ -707,6 +707,7 @@ rte_efd_create(const char *name, uint32_t > > max_num_rules, uint32_t key_len, > > > > error_unlock_exit: > > rte_mcfg_tailq_write_unlock(); > > + rte_free(te); > > rte_efd_free(table); > > > > return NULL; > > [Wang, Yipeng]=20 Thanks for the patch and sorry for the delay. The code looks good. Acked-by: Yipeng Wang