patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: David Marchand <david.marchand@redhat.com>,
	Thomas Monjalon <thomas@monjalon.net>
Cc: dev <dev@dpdk.org>, dpdk stable <stable@dpdk.org>,
	Ori Kam <orika@nvidia.com>, Xiaoyun Li <xiaoyun.li@intel.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>,
	Wei Zhao <wei.zhao1@intel.com>
Subject: Re: [PATCH] app/testpmd: remove useless pointer checks
Date: Fri, 20 May 2022 16:04:45 +0100	[thread overview]
Message-ID: <6817fb03-bf0d-89d2-774f-104fc247cb0b@amd.com> (raw)
In-Reply-To: <CAJFAV8x2eQYsa3ohMRdurf=w9vpdTo3ECRCQX8DgDkUV1SAi7Q@mail.gmail.com>

On 5/12/2022 8:19 AM, David Marchand wrote:
> On Tue, Mar 29, 2022 at 11:26 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>>
>> 24/03/2022 17:15, David Marchand:
>>> Parameters to this static helper can't be NULL.
>>> str has already been dereferenced in caller.
>>> dst and size point to variable in stack.
>>
>> The same function is copy/pasted in several places.
>> Why simplifying only this one? because of its static nature?
>>
>> Shouldn't we make it a common function as other string helpers?
> 
> Sorry, this thread fell through the cracks.
> 
> The issue was raised by covscan:
> 
> Error: REVERSE_INULL (CWE-476):
> dpdk-21.11/app/test-pmd/cmdline_flow.c:7705: deref_ptr: Directly
> dereferencing pointer "size".
> dpdk-21.11/app/test-pmd/cmdline_flow.c:7711: check_after_deref:
> Null-checking "size" suggests that it may be null, but it has already
> been dereferenced on all paths leading to the check.
> # 7709|       if ((src == NULL) ||
> # 7710|           (dst == NULL) ||
> # 7711|->         (size == NULL) ||
> # 7712|           (*size == 0))
> # 7713|           return -1;
> 
> 
> As for the rest of the code, there might be more cleanups to do, as followups.
> 

Proceeding with this one as it solves coverity issue,

Applied to dpdk-next-net/main, thanks.

      reply	other threads:[~2022-05-20 15:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 16:15 David Marchand
2022-03-29  9:26 ` Thomas Monjalon
2022-05-12  7:19   ` David Marchand
2022-05-20 15:04     ` Ferruh Yigit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6817fb03-bf0d-89d2-774f-104fc247cb0b@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=aman.deep.singh@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=orika@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=wei.zhao1@intel.com \
    --cc=xiaoyun.li@intel.com \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).