From: Jingjing Wu <jingjing.wu@intel.com>
To: wenzhuo.lu@intel.com
Cc: jingjing.wu@intel.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH] net/avf: fix unchecked return value issue
Date: Tue, 30 Jan 2018 13:56:24 +0800 [thread overview]
Message-ID: <1517291784-56273-1-git-send-email-jingjing.wu@intel.com> (raw)
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
next reply other threads:[~2018-01-30 6:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 5:56 Jingjing Wu [this message]
2018-01-30 9:10 Jingjing Wu
2018-01-31 19:20 ` 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=1517291784-56273-1-git-send-email-jingjing.wu@intel.com \
--to=jingjing.wu@intel.com \
--cc=dev@dpdk.org \
--cc=wenzhuo.lu@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).