From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ring: fix return value check
Date: Tue, 23 Apr 2019 16:31:00 +0100 [thread overview]
Message-ID: <20190423153100.97996-1-ferruh.yigit@intel.com> (raw)
Message-ID: <20190423153100.iahp9AgroUnlfUqzb9ImQgRnsQxSLayeA2Hz4qFb9Ts@z> (raw)
'rte_eth_dev_get_port_by_name()' return value is not checked caught by
coverity, adding return value check.
Coverity issue: 305853
Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/net/ring/rte_eth_ring.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 115a882b5..5ec646594 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -385,7 +385,11 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
return -1;
}
- rte_eth_dev_get_port_by_name(ring_name, &port_id);
+ ret = rte_eth_dev_get_port_by_name(ring_name, &port_id);
+ if (ret) {
+ rte_errno = ENODEV;
+ return -1;
+ }
return port_id;
}
--
2.20.1
next reply other threads:[~2019-04-23 15:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 15:31 Ferruh Yigit [this message]
2019-04-23 15:31 ` Ferruh Yigit
2019-04-23 15:49 ` Bruce Richardson
2019-04-23 15:49 ` Bruce Richardson
2019-04-24 16:49 ` Ferruh Yigit
2019-04-24 16:49 ` 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=20190423153100.97996-1-ferruh.yigit@intel.com \
--to=ferruh.yigit@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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).