[v3,4/8] net/hns3: fix uncheck return value warning
diff mbox series

Message ID 1603975917-28576-5-git-send-email-oulijun@huawei.com
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series
  • hns3 misc updates
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Lijun Ou Oct. 29, 2020, 12:51 p.m. UTC
From: Hongbo Zheng <zhenghongbo3@huawei.com>

There are coverity defects related "calling
hns3_reset_all_tqps without checking return value
in hns3_do_start".

This patch fixes the warning by add "void" declaration
because here is exception handling, hns3_reset_all_tqps
will have the corresponding error message if it is
handled incorrectly, so it is not necessary to check
hns3_reset_all_tqps return value, here keep ret as the
error code causing the exception.

Coverity issue: 363048
Fixes: fa29fe45a7b4 ("net/hns3: support queue start and stop")
Cc: stable@dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 6342c70..6b4be76 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -4752,7 +4752,13 @@  hns3_do_start(struct hns3_adapter *hns, bool reset_queue)
 
 err_config_mac_mode:
 	hns3_dev_release_mbufs(hns);
-	hns3_reset_all_tqps(hns);
+	/*
+	 * Here is exception handling, hns3_reset_all_tqps will have the
+	 * corresponding error message if it is handled incorrectly, so it is
+	 * not necessary to check hns3_reset_all_tqps return value, here keep
+	 * ret as the error code causing the exception.
+	 */
+	(void)hns3_reset_all_tqps(hns);
 	return ret;
 }