[dpdk-dev] [PATCH 1/3] ethdev: fix null pointer checking

Thomas Monjalon thomas at monjalon.net
Wed Apr 3 20:42:35 CEST 2019


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.




More information about the dev mailing list