From 40984bf253e1bccea72a38b2a0edd7c16ea22831 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Thu, 14 May 2020 01:52:48 +0530 Subject: [PATCH] app/eventdev: check Tx adapter service ID Fix unchecked return values reported by coverity. Coverity issue: 357755 Fixes: 032a965a8f1d ("app/eventdev: support Tx adapter") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- app/test-eventdev/test_pipeline_common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index 84c42b33ce..17088b1b48 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -392,12 +392,16 @@ pipeline_event_tx_adapter_setup(struct evt_options *opt, if (!(cap & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) { uint32_t service_id = -1U; - rte_event_eth_tx_adapter_service_id_get(consm, - &service_id); + ret = rte_event_eth_tx_adapter_service_id_get(consm, + &service_id); + if (ret != -ESRCH && ret != 0) { + evt_err("Failed to get Tx adptr service ID"); + return ret; + } ret = evt_service_setup(service_id); if (ret) { evt_err("Failed to setup service core" - " for Tx adapter\n"); + " for Tx adapter"); return ret; } } -- 2.20.1