From 109cd5026122c4174ef4b2c8a560d24d6eb07626 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Mon, 7 Nov 2016 14:05:34 +0100 Subject: fix isssues discovered by coverity scan Change-Id: I62deaaa47a9259c886efa702eb4279c1c481585f Signed-off-by: Damjan Marion --- vnet/vnet/devices/netmap/node.c | 5 +++-- vnet/vnet/feature/feature.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'vnet') diff --git a/vnet/vnet/devices/netmap/node.c b/vnet/vnet/devices/netmap/node.c index 1e2a6a2792f..54d0aa15c22 100644 --- a/vnet/vnet/devices/netmap/node.c +++ b/vnet/vnet/devices/netmap/node.c @@ -153,7 +153,7 @@ netmap_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node, while (r && n_left_to_next) { - vlib_buffer_t *b0 = 0, *first_b0 = 0; + vlib_buffer_t *first_b0 = 0; u32 offset = 0; u32 bi0 = 0, first_bi0 = 0, prev_bi0; u32 next_slot_index = (cur_slot_index + 1) % ring->num_slots; @@ -171,6 +171,7 @@ netmap_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node, while (data_len && n_free_bufs) { + vlib_buffer_t *b0; /* grab free buffer */ u32 last_empty_buffer = vec_len (nm->rx_buffers[cpu_index]) - 1; @@ -233,7 +234,7 @@ netmap_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node, /* redirect if feature path enabled */ vnet_feature_start_device_input_x1 (nif->sw_if_index, &next0, - b0, 0); + first_b0, 0); /* enque and take next packet */ vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, diff --git a/vnet/vnet/feature/feature.c b/vnet/vnet/feature/feature.c index c19b3e0ebbb..c518cc611a4 100644 --- a/vnet/vnet/feature/feature.c +++ b/vnet/vnet/feature/feature.c @@ -175,7 +175,7 @@ vnet_feature_enable_disable (const char *arc_name, const char *node_name, arc_index = vnet_get_feature_arc_index (arc_name); - if (arc_index == ~0) + if (arc_index == ~(u8) 0) return; cm = &fm->feature_config_mains[arc_index]; -- cgit 1.2.3-korg