DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ring: fix return value check
@ 2019-04-23 15:31 Ferruh Yigit
  2019-04-23 15:31 ` Ferruh Yigit
  2019-04-23 15:49 ` Bruce Richardson
  0 siblings, 2 replies; 6+ messages in thread
From: Ferruh Yigit @ 2019-04-23 15:31 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, stable

'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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-04-24 16:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 15:31 [dpdk-dev] [PATCH] net/ring: fix return value check Ferruh Yigit
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

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