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 04566A09E4; Thu, 22 Apr 2021 10:36:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81E1B413E6; Thu, 22 Apr 2021 10:36:59 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 849B54069D for ; Thu, 22 Apr 2021 10:36:57 +0200 (CEST) IronPort-SDR: CaYAJeTmsY1cWCejmqyf5cljCbPuHkT98xNi1uP9WWQCZTLGBNL2aInz0UMHlFjnJpmuWkcb+E R/UM7km+aPQQ== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="195879030" X-IronPort-AV: E=Sophos;i="5.82,242,1613462400"; d="scan'208";a="195879030" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2021 01:36:56 -0700 IronPort-SDR: odJ3cMBlLaQ9aw4JMAXKPa0rVdhuXP24h7tnBnTl950gnE2h9XSC3cidKfYbfGRhn9FL6rhd8I qJVMXncsfVJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,242,1613462400"; d="scan'208";a="384702565" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga003.jf.intel.com with ESMTP; 22 Apr 2021 01:36:56 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 22 Apr 2021 01:36:55 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Thu, 22 Apr 2021 01:36:55 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.174) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Thu, 22 Apr 2021 01:36:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K1dRL19n9Xrjd7rYdAmN8htmbhoe2utmpeLll90/77eODd+HojlidHzMTkITX9S4TkYugYsZHT7C5sCzLbunVBGNuUAAuGQ+Zrhw31o3LadTKPxXbW7ZnoPJKqWsGEou727AqBti/vJqUNlAbuSriGGvg++aasu2s1X7O22bxjKaNQZ2qBCoSXfTAj2hGXB9RGjGVM88odQLGsiWT8kx27lmZZAcoClvS78hQcNIhiB7iIqvogm+zawWyKmRmtiPgIRaHE+J5XhP13thl1EUIdQExsQwBk7r4b7Zh0oc8W0m9h8B/76yRWhz9FAZTn+LES5wSpu/WRrMp5Wu+ElkCg== 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=J+wua3Nz4L8isMhE5Clc2V61/W9cT+vxuWSzktescNE=; b=izxHs+NTkpHzmtqtRd/TbQAh3L1ao6L+oAY4d37Avt5eTkE1l3s4Llw1KJ4b/w1cqJggOorTrapqBXkTdHvCcbH4PmwyCp6x8JPr/BuNz9BkP4HlHLZYn5HiHGIZrb1HlbsiRgaUfO2eKmWsyrPMfI6Z9h81tqR5p6UrJoFvsj1XpRGw6APJG2leJ9+gaUlJx520+tR5ounUHVM0qUt1uEbdJz89kdagRT681aNMv56iW7VkilWRGUjufFnIm4YDlx3fJzs0qdG3NWO9Db/dh76jvlmA7RtvGDsvHnYLyNyYbhIBjMcDmppdc2OKNgURG9O+by3ae4YryAhHBWWIgQ== 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=J+wua3Nz4L8isMhE5Clc2V61/W9cT+vxuWSzktescNE=; b=T3s3dMgUzvjbnEyr6CCQRdbWfaQ3WNs4jL35qFj5CRJjwruXJUPjnzYSYTtnXRDBrwPlgBrhvjhipP3aR5ib+w3vRX809CtsL1j8rFS9pIit6CYvNl7pPO7vLLm3Ttbcb1pm76rigkdZ70BNs1LesJhj/fBRVeQ0azuhbaR4M0E= Received: from DM6PR11MB2796.namprd11.prod.outlook.com (2603:10b6:5:c8::23) by DM5PR11MB1884.namprd11.prod.outlook.com (2603:10b6:3:112::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.23; Thu, 22 Apr 2021 08:36:22 +0000 Received: from DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::d099:834d:f5ad:39c9]) by DM6PR11MB2796.namprd11.prod.outlook.com ([fe80::d099:834d:f5ad:39c9%3]) with mapi id 15.20.4042.024; Thu, 22 Apr 2021 08:36:22 +0000 From: "Dumitrescu, Cristian" To: "Min Hu (Connor)" , "dev@dpdk.org" CC: "Yigit, Ferruh" Thread-Topic: [PATCH] pipeline: fix deallocate null pointer Thread-Index: AQHXN0IgoJdHBq4ZKUCOqs3xCo77kKrANdUA Date: Thu, 22 Apr 2021 08:36:21 +0000 Message-ID: References: <1619073510-58316-1-git-send-email-humin29@huawei.com> In-Reply-To: <1619073510-58316-1-git-send-email-humin29@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [51.37.10.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5f53b7e6-397a-4535-115a-08d90569b557 x-ms-traffictypediagnostic: DM5PR11MB1884: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6g3w0ckRybskJilP7MtAtmn/JOhjP4JQCbRE4ez1PAWjdFCp51uf+ihe0ZPSYnXTk2LFyfHenyyHHCzmm0l5zlcDd0B2cztI0wGZCgJTbjV+oAbv58KE1knKUdjal6mXd/BCdG8SXRW08fRNSvQDj8Pdmr7ciPASZLiaVUhjG5xOkS3ivJA8GJmyqWkYtvCIzzKt1X9augYFJzXnU386kmRkgyo4LUEkWgOsdbbqGFG1Uxx1sQKD/VUhNfzCT9UHPTuIeEEWYe8uCJIaWKLoA6J91AbbTdQdXhefN9cTL3vlA7FUfJ5FUjnlRIikgdFtk1FhxzvytKL8rZTi1NLpCZh3tr1R3vu+uk7ONU/1+kpPeCsM+63iQ1vaRnp9o+nW2SZ0/w6+KKm8nEzZIuHh7GIwye9izEo/gjDcU/JIamSJpBj5It0WthkVet0v3KEH6L98sHQ4PA8iHLSn+71FqEcm2VWCkvH7G7rjtNsGUjjkKXJWGMSg7VcOFmQ9TkBrfvaPCk4VftiMnTqMLol2J+nozchd/J4tnJc9iysvEh1mKhUhKa2DMYOGnC3OcfiPk+n7c1zo9bYT/qFasJ1rIvx3/c/BxQyYCt0pI6Go9ic= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2796.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(376002)(346002)(136003)(396003)(66556008)(110136005)(26005)(66446008)(38100700002)(186003)(83380400001)(4326008)(53546011)(122000001)(33656002)(478600001)(7696005)(66946007)(52536014)(107886003)(5660300002)(76116006)(8676002)(316002)(6506007)(8936002)(64756008)(9686003)(66476007)(71200400001)(86362001)(2906002)(55016002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?+9SNwTwp7EAQYCxfRfgf2Wr1KZLuk+HCn1YWnRdUofmu9FGztddw04Y47g8Z?= =?us-ascii?Q?1hycpv8eD+9rTNmSEuSGlipplmqzaM/0HYt+CQbjC4KEQvjR9GiOh6FfdUHm?= =?us-ascii?Q?mPLWsnsQlE8UMohW7LGTCUamcLaePPQS34UrFsLsSDQwaNqrGTjvuqC21ED1?= =?us-ascii?Q?zsLqi9NXHQdIAHNidxWTfCwyRCISTfSyTNnB0/VySbiX88dWBc54qRwGqUUw?= =?us-ascii?Q?8iDppAyiEHXGHyeOsX6+VBp7XAcQ+iIYS5EDjIC88bzL32WqXfUH6jw0c6+m?= =?us-ascii?Q?IdrXlIeQ+YX8Hoe+SXLLxswuivAvsdMzS0FmcmAAl/KWfLrDJF11wKKiVJQT?= =?us-ascii?Q?UX+Tt/QCqlQEZwBP0xbNrIwbFXhjDoQvHHyMwm1Qv0FalXo+PnX5Iy0dfSjJ?= =?us-ascii?Q?j4arzDNKKQbX25IChyAFkIBjfHbOBVHyzXdMru8/EyJrtPkNuXzBiN4IaktG?= =?us-ascii?Q?GjugtI6FvO5bkY0ul7Pt42Qcuh9lrJ0OaOjKzL194jMzy4jK7Z2Ys7tIg4NH?= =?us-ascii?Q?jhffDOz38L0kY06ShaPsDTLYfOGWCwBGiDFIaJo6J0BoRRgN1JST10kWRK5f?= =?us-ascii?Q?TlK4Cer8khYYo/LW8DIVmtN3ZJ6dUu1rOXm5GMjmMrd+gKHJZRdq+dsecsf5?= =?us-ascii?Q?voQjA6I1oGQwzK6gIPX2S66e+8c7S+23pCwNFOIjQwDxfEwbEHCeOvzOtqMt?= =?us-ascii?Q?AlV2lrOrku5NU4bfLTqfiqNpVmmoRWkZpmyFvBuuqXrWdoMSBaPNQhHwuzLX?= =?us-ascii?Q?jcG4KRsHjjZWp1lUzQcgMM6KPChh4jBDns0i9oZPDkLutGqliu9+bLZwjYP2?= =?us-ascii?Q?/LmFGhbknKjMVtIWZtOXql46CS+xqy80WqeQZARugiPV1axVSIjpF0FqZs6+?= =?us-ascii?Q?jmcHDk0lMwH1vYzpXke1NuP9Vb2p+z2GDz25L20uOd4aiepOwVDOchVsgAbA?= =?us-ascii?Q?Wgnplo/MbxWnmRENliED9wOYCpkVYwntWg5Iq+eUg7WfJgtsKwH55OMXZzgr?= =?us-ascii?Q?tAdRRK66+/zRIaC+S5UJDVXOPHrmKYbXxRomSDzbuEvy4O866az13CocLgQQ?= =?us-ascii?Q?FzhjGefpizrT66bPB2Z72NzWCm8Ckvf0zFcXjw+ZJ9Iy0HgVfQRIxhMX357N?= =?us-ascii?Q?LCV83jH5r7kcLjzBcU614VWg6mrnWnCv6qeI5ODnBJa39EYeACEI2dXPojUX?= =?us-ascii?Q?zVcMeA95WNKcx1yAesQtC3yZ6Xq807VhMIvSbgJmhxEXBnI2oqaUg+TRqy/V?= =?us-ascii?Q?+ob4BAf43X7HeySdvsOXP1XBoOUB2iz43lT7eQ3NgBFuU+b/CKSAzKLTJ0zg?= =?us-ascii?Q?CnJBCwodSBgpt2/haH0Hf9vz?= 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: DM6PR11MB2796.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f53b7e6-397a-4535-115a-08d90569b557 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2021 08:36:22.0273 (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: 5qWcNQklhIzrRME3jOHBFsIYKVI+7IKCv8xJsCS2Tb7Lk+Kn6LHGly+RZ1yIWW3XsZePLyIuMw84clJh+AHpTPEr9VhSeyN4VEJK5YXUcLY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1884 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] pipeline: fix deallocate null pointer 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: Min Hu (Connor) > Sent: Thursday, April 22, 2021 7:39 AM > To: dev@dpdk.org > Cc: Yigit, Ferruh ; Dumitrescu, Cristian > > Subject: [PATCH] pipeline: fix deallocate null pointer >=20 > From: HongBo Zheng >=20 > Fix deallocate null pointer in instruction_config, while > pointer 'data' or 'instr' may be null. >=20 > Fixes: a1711f948dbf ("pipeline: add SWX Rx and extract instructions") > Cc: stable@dpdk.org >=20 > Signed-off-by: HongBo Zheng > Signed-off-by: Min Hu (Connor) > --- > lib/librte_pipeline/rte_swx_pipeline.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/librte_pipeline/rte_swx_pipeline.c > b/lib/librte_pipeline/rte_swx_pipeline.c > index 4455d91..6084635 100644 > --- a/lib/librte_pipeline/rte_swx_pipeline.c > +++ b/lib/librte_pipeline/rte_swx_pipeline.c > @@ -8015,8 +8015,10 @@ instruction_config(struct rte_swx_pipeline *p, > return 0; >=20 > error: > - free(data); > - free(instr); > + if (data) > + free(data); > + if (instr) > + free(instr); > return err; > } >=20 > -- > 2.7.4 Hi, NACK. Thanks for the patch, but the tests for data and instr being non-NULL befor= e calling free are not required, because: 1. Both data and instr are initialized to NULL. 2. free(NULL) is supported. Regards, Cristian