examples/l3fwd: check service core reset result
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Wed, 13 May 2020 20:20:25 +0000 (01:50 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 19 May 2020 17:15:14 +0000 (19:15 +0200)
Fix unchecked return values reported by coverity.

Coverity issue: 354235
Fixes: 8bd537e9c6cf ("examples/l3fwd: add service core setup based on caps")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
examples/l3fwd/main.c

index 84f171f..24ede42 100644 (file)
@@ -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) {