From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 1/3] ethdev: fix null pointer checking Date: Wed, 03 Apr 2019 20:42:35 +0200 Message-ID: <1588223.P5TngShShd@xps> References: <20190403160726.1231-1-mohammad.abdul.awal@intel.com> <53CAEE02C005744990339697D6A8BBC20352A87A@IRSMSX107.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: "Yigit, Ferruh" , "dev@dpdk.org" , "arybchenko@solarflare.com" , "stable@dpdk.org" To: "Awal, Mohammad Abdul" Return-path: In-Reply-To: <53CAEE02C005744990339697D6A8BBC20352A87A@IRSMSX107.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.