DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: fix passing negative parameter to strerror
Date: Mon, 8 Jun 2020 15:47:53 +0100	[thread overview]
Message-ID: <9c727094-5fcd-a1d5-b478-c9dfa63db0fe@intel.com> (raw)
In-Reply-To: <1591415197-10432-1-git-send-email-xavier.huwei@huawei.com>

On 6/6/2020 4:46 AM, Wei Hu (Xavier) wrote:
> Currently, there are coverity defect warnings those were found from the
> public coverity.
> https://scan.coverity.com/projects/dpdk-data-plane-development-kit
> 
> Coverity issue:
>   In nic_stats_clear function:
>     CID 358450 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
>     5. negative_returns: ret is passed to a parameter that cannot be
>        negative.
> 
>     CID 358449 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
>     6. negative_returns: ret is passed to a parameter that cannot be
>        negative.
> 
>   In nic_xstats_clear function:
>     CID 358437 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
>     6. negative_returns: ret is passed to a parameter that cannot be
>        negative.
> 
>     CID 349913 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
>     5. negative_returns: ret is passed to a parameter that cannot be
>        negative.


Shortened above as following:
    Coverity issue: 349913, 358437, 358449, 358450

> 
> This patch fixes them by passing '-ret' to the function strerror() when ret
> is negative.
> 
> Fixes: da328f7f115a ("ethdev: change xstats reset function to return int")
> Fixes: 9eb974221f44 ("app/testpmd: fix statistics after reset")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

> ---
> v2 -> v3:
> 	1. replace the coverity warning infromation with the ones found
> 	   from the public coverity in the commit log.

Thanks.


      reply	other threads:[~2020-06-08 14:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06  3:46 Wei Hu (Xavier)
2020-06-08 14:47 ` 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=9c727094-5fcd-a1d5-b478-c9dfa63db0fe@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=xavier.huwei@huawei.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).