diff options
author | Dave Barach <dave@barachs.net> | 2016-08-15 08:43:41 -0400 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2016-08-15 08:43:57 -0400 |
commit | c53191deb39231cf8408cf9eb0adf5c878ddda68 (patch) | |
tree | 914ced55a397e83debe1fd45dc2d53b607f5c14f /plugins | |
parent | be053b87cf321c34d780e9c79ad455513fb98395 (diff) |
VPP-189 Fix another batch of coverity warnings
Change-Id: I1d56bc9377db161ae9226e2b2da7c1916c8d1c3b
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ila-plugin/ila/ila.c | 4 | ||||
-rw-r--r-- | plugins/ioam-plugin/ioam/encap/ip6_ioam_pot.c | 2 | ||||
-rw-r--r-- | plugins/ioam-plugin/ioam/lib-pot/pot_util.c | 4 | ||||
-rw-r--r-- | plugins/sixrd-plugin/sixrd/sixrd.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/plugins/ila-plugin/ila/ila.c b/plugins/ila-plugin/ila/ila.c index a43aca13918..2673c6269d2 100644 --- a/plugins/ila-plugin/ila/ila.c +++ b/plugins/ila-plugin/ila/ila.c @@ -300,7 +300,7 @@ ila_ila2sir (vlib_main_t * vm, { ila_ila2sir_trace_t *tr = vlib_add_trace (vm, node, p0, sizeof (*tr)); - tr->ila_index = ie0 ? (ie0 - ilm->entries) : ~0; + tr->ila_index = ie0 - ilm->entries; tr->initial_dst = ip60->dst_address; tr->adj_index = vnet_buffer (p0)->ip.adj_index[VLIB_TX]; } @@ -309,7 +309,7 @@ ila_ila2sir (vlib_main_t * vm, { ila_ila2sir_trace_t *tr = vlib_add_trace (vm, node, p1, sizeof (*tr)); - tr->ila_index = ie1 ? (ie1 - ilm->entries) : ~0; + tr->ila_index = ie1 - ilm->entries; tr->initial_dst = ip61->dst_address; tr->adj_index = vnet_buffer (p1)->ip.adj_index[VLIB_TX]; } diff --git a/plugins/ioam-plugin/ioam/encap/ip6_ioam_pot.c b/plugins/ioam-plugin/ioam/encap/ip6_ioam_pot.c index 0a239457559..ec85ea72e5f 100644 --- a/plugins/ioam-plugin/ioam/encap/ip6_ioam_pot.c +++ b/plugins/ioam-plugin/ioam/encap/ip6_ioam_pot.c @@ -87,7 +87,7 @@ static u8 * format_ioam_pot (u8 * s, va_list * args) } s = format (s, "random = 0x%Lx, Cumulative = 0x%Lx, Index = 0x%x", - random, cumulative, pot0->reserved_profile_id); + random, cumulative, pot0 ? pot0->reserved_profile_id : ~0); return s; } diff --git a/plugins/ioam-plugin/ioam/lib-pot/pot_util.c b/plugins/ioam-plugin/ioam/lib-pot/pot_util.c index 0309cbecf4b..893a89cab33 100644 --- a/plugins/ioam-plugin/ioam/lib-pot/pot_util.c +++ b/plugins/ioam-plugin/ioam/lib-pot/pot_util.c @@ -59,7 +59,7 @@ pot_profile *pot_profile_find(u8 id) { pot_main_t *sm = &pot_main; - if (id >= 0 && id < MAX_POT_PROFILES) + if (id < MAX_POT_PROFILES) { return (&(sm->profile_list[id])); } @@ -280,7 +280,7 @@ static clib_error_t *set_pot_profile_command_fn(vlib_main_t * vm, u64 secret_share; u64 secret_key; u8 validator = 0; - u32 profile_id; + u32 profile_id = ~0; u32 bits; u64 lpc = 0, poly2 = 0; pot_profile *profile = NULL; diff --git a/plugins/sixrd-plugin/sixrd/sixrd.c b/plugins/sixrd-plugin/sixrd/sixrd.c index 8ebdb32b875..e842d49aa0a 100644 --- a/plugins/sixrd-plugin/sixrd/sixrd.c +++ b/plugins/sixrd-plugin/sixrd/sixrd.c @@ -187,7 +187,7 @@ sixrd_add_domain_command_fn (vlib_main_t *vm, ip4_address_t ip4_prefix; ip6_address_t ip6_prefix; ip4_address_t ip4_src; - u32 ip6_prefix_len, ip4_prefix_len, sixrd_domain_index; + u32 ip6_prefix_len=0, ip4_prefix_len=0, sixrd_domain_index; u32 num_m_args = 0; /* Optional arguments */ u32 mtu = 0; |