[1/4] net/hns3: fix passing negative parameter to strerror
diff mbox series

Message ID 1591692257-55884-2-git-send-email-xavier.huwei@huawei.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
  • Bugfixes of coverity defects for hns3 PMD driver
Related show


Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS

Commit Message

Wei Hu (Xavier) June 9, 2020, 8:44 a.m. UTC
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 mbox series

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) {
 		hns3_err(hw, "Hash table full? err:%d(%s)!", ret,
-			 strerror(ret));
+			 strerror(-ret));
 		return ret;