From: Jingjing Wu Date: Tue, 30 Jan 2018 09:10:36 +0000 (+0800) Subject: net/avf: fix unchecked return in link update X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=29bc629498da1a83febea81ec8935beff7e1ea16;p=dpdk.git net/avf: fix unchecked return in link update This patch fixes the coverity CHECKED_RETURN issue. Coverity issue: 257045 Fixes: 48de41ca11f0 ("net/avf: enable link status update") Reported-by: John McNamara Signed-off-by: Jingjing Wu --- diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c index b1be7f4e07..3f210b2fcc 100644 --- a/drivers/net/avf/avf_ethdev.c +++ b/drivers/net/avf/avf_ethdev.c @@ -611,9 +611,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; }