DPDK patches and discussions
 help / color / mirror / Atom feed
From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
	Ori Kam <orika@mellanox.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	"Radu Nicolau" <radu.nicolau@intel.com>,
	Akhil Goyal <akhil.goyal@nxp.com>,
	"Tomasz Kantecki" <tomasz.kantecki@intel.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Pavan Nikhilesh <pbhagavatula@marvell.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH] examples/l3fwd: fix unchecked function return values
Date: Thu, 14 May 2020 01:50:25 +0530	[thread overview]
Message-ID: <20200513202026.5091-1-pbhagavatula@marvell.com> (raw)

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Fix unchecked return values reported by coverity.

Coverity issue: 354235
Fixes: 8bd537e9c6cf ("examples/l3fwd: add service core setup based on caps")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l3fwd/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 84f171f18..24ede4290 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1112,8 +1112,9 @@ l3fwd_service_enable(uint32_t service_id)
 	/* Get the core which has least number of services running. */
 	while (slcore_count--) {
 		/* Reset default mapping */
-		rte_service_map_lcore_set(service_id,
-				slcore_array[slcore_count], 0);
+		if (rte_service_map_lcore_set(service_id,
+				slcore_array[slcore_count], 0) != 0)
+			return -ENOENT;
 		service_count = rte_service_lcore_count_services(
 				slcore_array[slcore_count]);
 		if (service_count < min_service_count) {
-- 
2.17.1


             reply	other threads:[~2020-05-13 20:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 20:20 pbhagavatula [this message]
2020-05-19 16:45 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200513202026.5091-1-pbhagavatula@marvell.com \
    --to=pbhagavatula@marvell.com \
    --cc=akhil.goyal@nxp.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=marko.kovacevic@intel.com \
    --cc=orika@mellanox.com \
    --cc=radu.nicolau@intel.com \
    --cc=skori@marvell.com \
    --cc=tomasz.kantecki@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).