From bd6462e16a55a63561bfaaf75018aa378f201343 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Fri, 16 Dec 2016 09:20:04 -0500 Subject: Coverity fixes, VPP-486 Change-Id: I8906bb983128e8f6e2664e367d2015325c1125fb Signed-off-by: Dave Barach --- plugins/acl-plugin/acl/l2sess_node.c | 4 ++-- vnet/vnet/mpls/mpls.c | 10 +++++----- vnet/vnet/sr/sr_replicate.c | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/acl-plugin/acl/l2sess_node.c b/plugins/acl-plugin/acl/l2sess_node.c index d83029ea..520e5929 100644 --- a/plugins/acl-plugin/acl/l2sess_node.c +++ b/plugins/acl-plugin/acl/l2sess_node.c @@ -463,7 +463,7 @@ session_is_alive (l2sess_main_t * sm, l2s_session_t * sess, u64 now, u64 *last_a return is_alive; } -void +static void check_idle_sessions (l2sess_main_t * sm, u32 sw_if_index, u64 now) { sm->timer_wheel_next_expiring_time = 0; @@ -493,7 +493,7 @@ check_idle_sessions (l2sess_main_t * sm, u32 sw_if_index, u64 now) if (PREDICT_FALSE (_vec_len (sm->data_from_advancing_timing_wheel) > 0)) { uword i; - for (i = 0; i < vec_len (sm->data_from_advancing_timing_wheel); i++) + for (i = 0; i < _vec_len (sm->data_from_advancing_timing_wheel); i++) { u32 session_index = sm->data_from_advancing_timing_wheel[i]; if (!pool_is_free_index (sm->sessions, session_index)) diff --git a/vnet/vnet/mpls/mpls.c b/vnet/vnet/mpls/mpls.c index c3e642a6..0e610e17 100644 --- a/vnet/vnet/mpls/mpls.c +++ b/vnet/vnet/mpls/mpls.c @@ -415,17 +415,17 @@ vnet_mpls_local_label (vlib_main_t * vm, fib_node_index_t lfe, fib_index; u32 fi; - pfx.fp_proto = FIB_PROTOCOL_MPLS; - pfx.fp_len = 21; - pfx.fp_label = local_label; - pfx.fp_payload_proto = fib_proto_to_dpo(rpaths[0].frp_proto); - if (NULL == rpaths) { error = clib_error_return(0 , "no paths"); goto done; } + pfx.fp_proto = FIB_PROTOCOL_MPLS; + pfx.fp_len = 21; + pfx.fp_label = local_label; + pfx.fp_payload_proto = fib_proto_to_dpo(rpaths[0].frp_proto); + /* * the CLI parsing stored table Ids, swap to FIB indicies */ diff --git a/vnet/vnet/sr/sr_replicate.c b/vnet/vnet/sr/sr_replicate.c index 34cde3d2..5f9de504 100644 --- a/vnet/vnet/sr/sr_replicate.c +++ b/vnet/vnet/sr/sr_replicate.c @@ -253,6 +253,8 @@ sr_replicate_node_fn (vlib_main_t * vm, /* Not the last tunnel to process */ clone0 = rte_pktmbuf_clone (orig_mb0, bm->pktmbuf_pools[socket_id]); + if (clone0 == 0) + goto clone_fail; nb_seg = 0; clone0i = clone0; clone0_c = NULL; @@ -289,6 +291,7 @@ sr_replicate_node_fn (vlib_main_t * vm, if (PREDICT_FALSE (!clone0 || !hdr_mb0)) { + clone_fail: b0->error = node->errors[SR_REPLICATE_ERROR_NO_BUFFERS]; vec_foreach_index (i, rte_mbuf_vec) -- cgit 1.2.3-korg