aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-11-07 14:05:34 +0100
committerChris Luke <chris_luke@comcast.com>2016-11-07 14:51:46 +0000
commit109cd5026122c4174ef4b2c8a560d24d6eb07626 (patch)
tree5cbd241c916df249c6d3561b2eb96ca27b951ddc /vnet
parent275b146bc14f4a1156c24fe954c835c70932cc10 (diff)
fix isssues discovered by coverity scan
Change-Id: I62deaaa47a9259c886efa702eb4279c1c481585f Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/netmap/node.c5
-rw-r--r--vnet/vnet/feature/feature.c2
2 files changed, 4 insertions, 3 deletions
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];