DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/avf: fix unchecked return value issue
@ 2018-01-30  5:54 Jingjing Wu
  0 siblings, 0 replies; only message in thread
From: Jingjing Wu @ 2018-01-30  5:54 UTC (permalink / raw)
  To: wenzhuo.lu; +Cc: jingjing.wu, dev

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 --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;
 }
-- 
2.4.11

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-30  6:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30  5:54 [dpdk-dev] [PATCH 1/2] net/avf: fix unchecked return value issue Jingjing Wu

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).