From f34a476df925db301df9f74e2b5007392b09ae8a Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Fri, 22 Nov 2019 00:52:39 +0530 Subject: [PATCH] app/eventdev: check function errors [ upstream commit a8d88bfbce00b6f3b1e4c4a3a4464954a21372dd ] Fix unchecked return values reported by coverity. Coverity Issue: 336861 Coverity Issue: 349906 Fixes: 032a965a8f1d ("app/eventdev: support Tx adapter") Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- app/test-eventdev/test_pipeline_common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index 5db3ffde17..c988da28c9 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -159,6 +159,7 @@ int pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) { uint16_t i; + int ret; uint8_t nb_queues = 1; struct test_pipeline *t = evt_test_priv(test); struct rte_eth_rxconf rx_conf; @@ -187,7 +188,12 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) struct rte_eth_conf local_port_conf = port_conf; uint32_t caps = 0; - rte_event_eth_tx_adapter_caps_get(opt->dev_id, i, &caps); + ret = rte_event_eth_tx_adapter_caps_get(opt->dev_id, i, &caps); + if (ret != 0) { + evt_err("failed to get event tx adapter[%d] caps", i); + return ret; + } + if (!(caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) t->internal_port = 0;