diff mbox

[dpdk-dev] net/avf: fix unchecked return value issue

Message ID 1517291784-56273-1-git-send-email-jingjing.wu@intel.com (mailing list archive)
State Superseded, archived
Headers show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Wu, Jingjing Jan. 30, 2018, 5:56 a.m. UTC
This patch fixes the coverity CHECKED_RETURN issue.

Coverity issue: 257045
Fixes: 48de41ca11f0 ("net/avf: enable link status update")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/avf/avf_ethdev.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index cf7bbb2..511715f 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -609,9 +609,10 @@  avf_dev_link_update(struct rte_eth_dev *dev,
 	new_link.link_autoneg = !!(dev->data->dev_conf.link_speeds &
 				ETH_LINK_SPEED_FIXED);
 
-	rte_atomic64_cmpset((uint64_t *)&dev->data->dev_link,
-			    *(uint64_t *)&dev->data->dev_link,
-			    *(uint64_t *)&new_link);
+	if(rte_atomic64_cmpset((uint64_t *)&dev->data->dev_link,
+			       *(uint64_t *)&dev->data->dev_link,
+			       *(uint64_t *)&new_link) == 0)
+		return -1;
 
 	return 0;
 }