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 926D9A04A7; Mon, 24 Jan 2022 11:17:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C134410F2; Mon, 24 Jan 2022 11:17:54 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id ABE0640E0F for ; Mon, 24 Jan 2022 11:17:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643019472; x=1674555472; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zGc5U2To4EL2aYErbWpskf1zopXU3fX+ix9RIhd4viM=; b=Ouv6IRpKA47O7BLN1c4irV+6OkxzHqkZcz6Qk60bDOYPZaKM2QNJMkyA qJTURk+q5ug2BYSwfiopVGKJVDtOmUsZxlMZ3W/uxFzo5WGDNBORyeiaH nJ9mfzmlbsFqTG+wyNVUfQuPAMQJhVopEs94h8dicecyeagbaZwChda5O IN/nNU22SpHnODQBSTGQHGv54Bw6E6qMMtq0gmMS27A9JYBZWI0TH5788 0CDK9ZHdwTI94vQSc5B0rbEVF0hUf4O4eq7+cEEmp+Chq6MhPAPQBB3xL hb4Km6p+p8OH3oUxVjgcLB0NKSu4/MoAzMZitg8w/VmEISM3nZR3JUBPB A==; X-IronPort-AV: E=McAfee;i="6200,9189,10236"; a="309334310" X-IronPort-AV: E=Sophos;i="5.88,311,1635231600"; d="scan'208";a="309334310" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 02:17:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,311,1635231600"; d="scan'208";a="580322755" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga008.fm.intel.com with ESMTP; 24 Jan 2022 02:17:51 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 24 Jan 2022 02:17:50 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 24 Jan 2022 02:17:50 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) 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.2308.20; Mon, 24 Jan 2022 02:17:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mm4rWpeP7SxY6QOnusp2/A04d53zI5fZHIryYBOLB5EgVz9uaQ/J1aCzJs07Kgz9SrxEnNuwC6JO90m39emlXPxdDBVbl4o/6/Fe23ybYB+IQojMwe/CwZK+w7rfki0zqr1Z7PoJRAfRa5cgZ/D3HXxf9SIjcwqAyErbAVYOz8OaCyOQm8omnuAvlPXB8pE0aQBYjX/7D8vTSAa7MPSi/y+TNWQsdsMFgU/RwV2sdbBnvlY36qHutdKK/KssWArLU+wFEP2zmpYGV4mfw0AccdlRzmBSXPxqC2BuPELZcc5Rrjth6vOzHzrM39iZz82uCRQy6P7EWaJvz3Dh8t7YIg== 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=qn51SFK+PklF/60v6KMf5ZUy2J2a47CT6LDKXJjNBtA=; b=A7Rev4Y44ix25Ap75o2D+dtMPAgoR8iVYHGOEez+EhRZgkCC9yzBi2UWAQsBtScscJMbOhchFkI8i8/Se7tvUwX9v6zUT8wEgdSIwcdPhNDW47Hi2Xq+h5VyGUTrr9/rTvANnfWUveCleXisAq31IV88A+4HXQwsFgCCyx/WlofJ/lbNzz0yf12W19ZIwmJRbgtaHwcQ2wg394vkmIHqk+YVJBxDUeb2kOsKDbwDCZ9bYSt6T7p8yoJl8OudS5MO8RZyyufLcfKB1xg3eGXPfUafSk4YTt3vMK6hbwQYF1G8Grxub5biaqrIh/6q+3OKNHte2kM1McSEhUBplpcYLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DM8PR11MB5670.namprd11.prod.outlook.com (2603:10b6:8:37::12) by BN7PR11MB2545.namprd11.prod.outlook.com (2603:10b6:406:b0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 10:17:49 +0000 Received: from DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::e9b0:843e:2b39:6680]) by DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::e9b0:843e:2b39:6680%5]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 10:17:49 +0000 From: "Dumitrescu, Cristian" To: Stephen Hemminger , "dev@dpdk.org" CC: "Singh, Jasvinder" Subject: RE: [PATCH 63/82] net/softnic: remove unnecessary NULL checks Thread-Topic: [PATCH 63/82] net/softnic: remove unnecessary NULL checks Thread-Index: AQHYELZAUegfiTWGAECQZAt/d7I1baxx9clw Date: Mon, 24 Jan 2022 10:17:48 +0000 Message-ID: References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124000518.319850-64-stephen@networkplumber.org> In-Reply-To: <20220124000518.319850-64-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 86a3f14b-0d08-40e8-705c-08d9df22c5cf x-ms-traffictypediagnostic: BN7PR11MB2545:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: feGfyX4VgEk8csUnI6mRVIP9VRNiMOnQQupdVmSxbNrblT7rm2SX8pfvSHWAO3SmEYWFciJc6bKz9H8p57KrZxY2fAwhYSd7PemSbHyzqlYjPEr0WxEpOzP88qBvCAuM/+6SEuyf2a7fyUglj9u0rL3p6Nu0iNoFbLLrEzbFBrcecbmkNG1QeAO7tJVrTFL/CWghVrX+znEbTVG/m9Mx5cbjhCSoPJ85c+qVx5GPkTZgESibRAoO3uekp/fLWUl8ieb7yyprmnPy8s8Kyiv3OOPr/ffN3iGHdeFAJSr3cyO60cPw+9mGIf6ZUMg/MyqGABMszU8bcxDly0NQWb0R91NYw/LS0wSDhMaLa6LD1vc2cPkvC6ySqv/Uci92emWdUuBwjNl5QlL7rjLqLEtzSqJmVJclnZlHVu60+F+I70jeO9zb/IAvoJoOMB38whe3lmuIzVzKB5LnbLuAQkKb8zUwWDHwSph4tk0GGh2beVtTaw8Foo2ftPr7ORcW+axgW9YjjyCz4Owfofwqpi9CbJTy0TBBI4MAoJ27NmPAoA/OUpPccvl/+mna0GW9+BxSAKNcSYPJyrIr3O1DB1v1hNrG8lzuvUtkeuS3OEnklqqMOW+ZxpY2mQrDwz1zpf2kiq/9JHrPRxI/NIXbqD0w7XVw1gBe5AcU902hLeT3U14xv+gEFzjjV+rByDGBINxjAePMQijkG0Gqz9FjFE90qw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5670.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(26005)(82960400001)(38070700005)(33656002)(5660300002)(55016003)(508600001)(186003)(52536014)(6506007)(86362001)(8936002)(9686003)(76116006)(66946007)(71200400001)(8676002)(316002)(53546011)(110136005)(64756008)(7696005)(83380400001)(122000001)(38100700002)(2906002)(107886003)(66446008)(66476007)(66556008)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aZZagADXw8NOYUjNoI+xx+Rl+k4oO9oYh6BbF9EL00VQ2NWn/rrx4dLh+2j7?= =?us-ascii?Q?hZzoAeTweGi3tBcn63qaJUPNPDf1KdGtzyQ2Fl5aSGf3BqrszPrdY86WbbJh?= =?us-ascii?Q?ppA/38iRnfALYLPXql4LyFdrcPXNytTIlj4kMiFzcJSTDFKNzGybEUk9uCyG?= =?us-ascii?Q?2gbXQIrJ3IQO58iS7C9xCHpz1JkQE4rfZtrnDXBnNqANFTg7wfBcLuOQ4oUH?= =?us-ascii?Q?XpkDkCKtaCs5hPCVnoBCagv7moFno7WOmWXK5VI8Uv6IrzkKfsuUgI4Q8tnE?= =?us-ascii?Q?G+QjmlxnCS7r3BkBHht5oamL50oJzAajf9QtKVsUuHopkhC5bjJLypdy4Zb2?= =?us-ascii?Q?aeiz7O1uO+wtjzKXaXRZcYiKPqv6WSquBPrrushMZMRY6++t2i8u69XeDktK?= =?us-ascii?Q?trBy830d7oI+uWEmEUo15L5vlooN5ctM31BxCG4ZJxIEc8RBVzy+2mBlMJQf?= =?us-ascii?Q?74KkBrppmdQxq8lNeQApImGPU0fdsHSnP9mdEnmXvpVF5tfNRYzDQLEJSUxc?= =?us-ascii?Q?Z3bxW+UellRjQGitDLU2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ascii?Q?j7ZRPYqsGHLSqDbWTi/1piulqumdpb/6jes0EfOwZQNWfBKBCArboVsY468K?= =?us-ascii?Q?P4bQEy/geXGceCCdzXl3i92XePl6CoMc1asjnnc+6X15v4aVuC6kynIHnXDL?= =?us-ascii?Q?sQ9/OJggyYqI4L6PKZ1O8MIG23F8Jkl8xmpFq2gWXaQFQ3Qv/oFfjT0ake2Y?= =?us-ascii?Q?RHyQO449Kjg1UTZD0NPvjkqNIqWiffGGzkwj0igjzdJY4NioA89NvOd8VLV8?= =?us-ascii?Q?gD9RyA=3D=3D?= 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: DM8PR11MB5670.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86a3f14b-0d08-40e8-705c-08d9df22c5cf X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2022 10:17:48.9443 (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: AVE+n4+/1z1ZmBBI0UkH4FKJ6asoXDJooH+W1aHyKMz3Dd8en7TGaBDwjijWkkrepgk456MPPFp7JRteieHT1DTRhH8pBI+DVjdJyQAaemg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2545 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Stephen Hemminger > Sent: Monday, January 24, 2022 12:05 AM > To: dev@dpdk.org > Cc: Stephen Hemminger ; Singh, Jasvinder > ; Dumitrescu, Cristian > > Subject: [PATCH 63/82] net/softnic: remove unnecessary NULL checks >=20 > Remove redundant NULL pointer checks before free functions > found by nullfree.cocci >=20 > Signed-off-by: Stephen Hemminger > --- > drivers/net/softnic/rte_eth_softnic_cli.c | 12 ++++-------- > drivers/net/softnic/rte_eth_softnic_cryptodev.c | 6 ++---- > drivers/net/softnic/rte_eth_softnic_thread.c | 6 ++---- > 3 files changed, 8 insertions(+), 16 deletions(-) >=20 Hi Stephen, The rte_ring_free() and rte_mempool_free() do not state in their API descri= ption that freeing a NULL pointer is harmless. Before pushing these changes= , please add the necessary note in the API header files for these functions= . In the absence of the clear note in their API description, the user is forc= ed to check for the NULL pointer. I agree that the implementation of these = functions does the right think and exits early when the input pointer is NU= LL, but there is no guarantee that the implementation is not going to chang= e. Agree? The stdlib free() and the rte_free() do have the clear API description note= that freeing a NULL object is harmless, so removing the NULL check before = their call is indeed safe. This stands for all the patches in this set. Regards, Cristian