app/eventdev: fix unchecked function return values
diff mbox series

Message ID 20200513202249.6295-1-pbhagavatula@marvell.com
State Accepted, archived
Delegated to: Jerin Jacob
Headers show
Series
  • app/eventdev: fix unchecked function return values
Related show

Checks

Context Check Description
ci/iol-testing fail Testing issues
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Pavan Nikhilesh Bhagavatula May 13, 2020, 8:22 p.m. UTC
From: Pavan Nikhilesh <pbhagavatula@marvell.com>

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>
---
 app/test-eventdev/test_pipeline_common.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jerin Jacob May 14, 2020, 1:17 p.m. UTC | #1
On Thu, May 14, 2020 at 1:53 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> 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>
> ---
>  app/test-eventdev/test_pipeline_common.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
> index 84c42b33c..f1c227941 100644
> --- a/app/test-eventdev/test_pipeline_common.c
> +++ b/app/test-eventdev/test_pipeline_common.c
> @@ -392,8 +392,12 @@ 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\n");

\n is not required as evt_err has it.

Acked-by: Jerin Jacob <jerinj@marvell.com>

Fixed and Applied to dpdk-next-eventdev/master. Thanks.



> +                               return ret;
> +                       }

Patch
diff mbox series

diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 84c42b33c..f1c227941 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -392,8 +392,12 @@  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\n");
+				return ret;
+			}
 			ret = evt_service_setup(service_id);
 			if (ret) {
 				evt_err("Failed to setup service core"