From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
To: <dev@dpdk.org>
Cc: <xavier.huwei@huawei.com>, <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH 1/4] net/hns3: fix passing negative parameter to strerror
Date: Tue, 9 Jun 2020 16:44:14 +0800 [thread overview]
Message-ID: <1591692257-55884-2-git-send-email-xavier.huwei@huawei.com> (raw)
In-Reply-To: <1591692257-55884-1-git-send-email-xavier.huwei@huawei.com>
There is a coverity defect related "Argument cannot be negative".
This patch fixes it by passing '-ret' to the function strerror() when ret
is negative.
Coverity issue: 349933
Fixes: fcba820d9b9e ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
drivers/net/hns3/hns3_fdir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index 4c5928f..7bc5bf8 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -893,7 +893,7 @@ static int hns3_insert_fdir_filter(struct hns3_hw *hw,
if (ret < 0) {
rte_spinlock_unlock(&fdir_info->flows_lock);
hns3_err(hw, "Hash table full? err:%d(%s)!", ret,
- strerror(ret));
+ strerror(-ret));
return ret;
}
--
2.7.4
next prev parent reply other threads:[~2020-06-09 8:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 8:44 [dpdk-dev] [PATCH 0/4] Bugfixes of coverity defects for hns3 PMD driver Wei Hu (Xavier)
2020-06-09 8:44 ` Wei Hu (Xavier) [this message]
2020-06-09 8:44 ` [dpdk-dev] [PATCH 2/4] net/hns3: avoid unchecked return value in reset err process Wei Hu (Xavier)
2020-06-09 8:44 ` [dpdk-dev] [PATCH 3/4] net/hns3: fix unintended sign extension in fd operation Wei Hu (Xavier)
2020-06-09 8:44 ` [dpdk-dev] [PATCH 4/4] net/hns3: fix unintended sign extension in dump operation Wei Hu (Xavier)
2020-06-10 9:46 ` [dpdk-dev] [PATCH 0/4] Bugfixes of coverity defects for hns3 PMD driver Ferruh Yigit
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=1591692257-55884-2-git-send-email-xavier.huwei@huawei.com \
--to=xavier.huwei@huawei.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@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).