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

Ferruh Yigit ferruh.yigit at intel.com
Wed Apr 3 18:52:44 CEST 2019


On 4/3/2019 5:41 PM, Bruce Richardson wrote:
> On Wed, Apr 03, 2019 at 05:35:22PM +0100, Ferruh Yigit wrote:
>> 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 :)
>>
> True, but if these are control path or init time code paths rather than
> data path APIs, I don't see the harm in putting in the checks.

No harm from performance point of view, agree, but also looks unnecessary to me.


More information about the dev mailing list