app/eventdev: check Tx adapter service ID
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Wed, 13 May 2020 20:22:48 +0000 (01:52 +0530)
committerJerin Jacob <jerinj@marvell.com>
Thu, 14 May 2020 13:16:37 +0000 (15:16 +0200)
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 <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
app/test-eventdev/test_pipeline_common.c

index 84c42b3..17088b1 100644 (file)
@@ -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;
                        }
                }