From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id DAEFD1B51A; Wed, 3 Apr 2019 20:42:39 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 66298220CB; Wed, 3 Apr 2019 14:42:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2019 14:42:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=z7JIqiqcGL64QSa8iwx8WbwiIt/8kuUop6pbD8KmZnc=; b=KNan5u+hH+7K s4uA0ItkE43uIRCg7jhGAUQK4AIVcBT1OixC53elxQpKcoPkZSNmwjsL6GSa7gAM dqxpL6RJlVJDealY9sHZ7bnyke0yH1DGeHGL3D4DVuew8nHmLBDgikMookCXEVi6 W2FVvukphDw2KF095OQrmiLvJifEOd8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=z7JIqiqcGL64QSa8iwx8WbwiIt/8kuUop6pbD8KmZ nc=; b=OdjzYsQ/1Aj0hzCn9DGVQ71dMgiPFWMvgOE8vsHoqMc7UrK5JFkpzHmPY JCdQ+OVdGCiHT4wcjYaJLWyhFy+wmwnXc4vcfn6o71Dz3Bhojf8SyBGQTWx3EwOw 4wnvN+2ro8Kd/svSg/5Gte1Kow9t1UkO/ScFUj85e5mxzBZE4CkvwSpneGi1P8c0 MH5U36AoliqZmdq4K4L3FQ/QAZHO4U7rb1609wQGQhX/5K47MKyr1mj/ovv+til1 ix6QsgAjYaq0KHOCtPar2i3Z5hpRiW950d7L05UluaY5JN+btCGc3pGREHVaRFvx Aya2mkKJ+RMasx6T6ojWbTby90FOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdefgddutddvucdltddurdeguddtrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttddv necuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjh grlhhonhdrnhgvtheqnecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghm pehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id BE313E4176; Wed, 3 Apr 2019 14:42:37 -0400 (EDT) From: Thomas Monjalon To: "Awal, Mohammad Abdul" Cc: "Yigit, Ferruh" , "dev@dpdk.org" , "arybchenko@solarflare.com" , "stable@dpdk.org" Date: Wed, 03 Apr 2019 20:42:35 +0200 Message-ID: <1588223.P5TngShShd@xps> In-Reply-To: <53CAEE02C005744990339697D6A8BBC20352A87A@IRSMSX107.ger.corp.intel.com> References: <20190403160726.1231-1-mohammad.abdul.awal@intel.com> <53CAEE02C005744990339697D6A8BBC20352A87A@IRSMSX107.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: fix null pointer checking 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: , X-List-Received-Date: Wed, 03 Apr 2019 18:42:40 -0000 03/04/2019 19:30, Awal, Mohammad Abdul: > From: Yigit, Ferruh > > On 4/3/2019 5:27 PM, Thomas Monjalon wrote: > > > 03/04/2019 18:07, Mohammad Abdul Awal: > > >> Null value for parameter name will cause segfault for the > > >> strnlen and strcmp functions. > > > > > > I'm not sure we want such obvious checks for all APIs. > > > Here I would say yes. > > > > These are internal functions, not APIs. > > I am for verifying input for (all) APIs but not for internal functions, drivers > > should call them and they are in our control, if they are passing NULL we can > > fix them :) > > The null checks are for the input param "char *name" of APIs rte_eth_dev_allocate and rte_eth_dev_attach_secondary. > I will change the err msg to suggested one. As Ferruh said, these are not really API in the sense that they are not called by the applications but only by drivers. PS: please write replies below original text. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 099B2A0679 for ; Wed, 3 Apr 2019 20:42:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F77D1B563; Wed, 3 Apr 2019 20:42:41 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id DAEFD1B51A; Wed, 3 Apr 2019 20:42:39 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 66298220CB; Wed, 3 Apr 2019 14:42:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Apr 2019 14:42:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=z7JIqiqcGL64QSa8iwx8WbwiIt/8kuUop6pbD8KmZnc=; b=KNan5u+hH+7K s4uA0ItkE43uIRCg7jhGAUQK4AIVcBT1OixC53elxQpKcoPkZSNmwjsL6GSa7gAM dqxpL6RJlVJDealY9sHZ7bnyke0yH1DGeHGL3D4DVuew8nHmLBDgikMookCXEVi6 W2FVvukphDw2KF095OQrmiLvJifEOd8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=z7JIqiqcGL64QSa8iwx8WbwiIt/8kuUop6pbD8KmZ nc=; b=OdjzYsQ/1Aj0hzCn9DGVQ71dMgiPFWMvgOE8vsHoqMc7UrK5JFkpzHmPY JCdQ+OVdGCiHT4wcjYaJLWyhFy+wmwnXc4vcfn6o71Dz3Bhojf8SyBGQTWx3EwOw 4wnvN+2ro8Kd/svSg/5Gte1Kow9t1UkO/ScFUj85e5mxzBZE4CkvwSpneGi1P8c0 MH5U36AoliqZmdq4K4L3FQ/QAZHO4U7rb1609wQGQhX/5K47MKyr1mj/ovv+til1 ix6QsgAjYaq0KHOCtPar2i3Z5hpRiW950d7L05UluaY5JN+btCGc3pGREHVaRFvx Aya2mkKJ+RMasx6T6ojWbTby90FOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdefgddutddvucdltddurdeguddtrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttddv necuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjh grlhhonhdrnhgvtheqnecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghm pehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id BE313E4176; Wed, 3 Apr 2019 14:42:37 -0400 (EDT) From: Thomas Monjalon To: "Awal, Mohammad Abdul" Cc: "Yigit, Ferruh" , "dev@dpdk.org" , "arybchenko@solarflare.com" , "stable@dpdk.org" Date: Wed, 03 Apr 2019 20:42:35 +0200 Message-ID: <1588223.P5TngShShd@xps> In-Reply-To: <53CAEE02C005744990339697D6A8BBC20352A87A@IRSMSX107.ger.corp.intel.com> References: <20190403160726.1231-1-mohammad.abdul.awal@intel.com> <53CAEE02C005744990339697D6A8BBC20352A87A@IRSMSX107.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: fix null pointer checking 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" Message-ID: <20190403184235.YdhZzZSFryG-ZIVfz7rcLaROtN3jqu1L8hQ3HJkDuFU@z> 03/04/2019 19:30, Awal, Mohammad Abdul: > From: Yigit, Ferruh > > On 4/3/2019 5:27 PM, Thomas Monjalon wrote: > > > 03/04/2019 18:07, Mohammad Abdul Awal: > > >> Null value for parameter name will cause segfault for the > > >> strnlen and strcmp functions. > > > > > > I'm not sure we want such obvious checks for all APIs. > > > Here I would say yes. > > > > These are internal functions, not APIs. > > I am for verifying input for (all) APIs but not for internal functions, drivers > > should call them and they are in our control, if they are passing NULL we can > > fix them :) > > The null checks are for the input param "char *name" of APIs rte_eth_dev_allocate and rte_eth_dev_attach_secondary. > I will change the err msg to suggested one. As Ferruh said, these are not really API in the sense that they are not called by the applications but only by drivers. PS: please write replies below original text.