DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/l3fwd: fix unchecked function return values
@ 2020-05-13 20:20 pbhagavatula
  2020-05-19 16:45 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: pbhagavatula @ 2020-05-13 20:20 UTC (permalink / raw)
  To: jerinj, Marko Kovacevic, Ori Kam, Bruce Richardson, Radu Nicolau,
	Akhil Goyal, Tomasz Kantecki, Sunil Kumar Kori, Pavan Nikhilesh
  Cc: dev

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-19 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 20:20 [dpdk-dev] [PATCH] examples/l3fwd: fix unchecked function return values pbhagavatula
2020-05-19 16:45 ` Thomas Monjalon

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).