diff options
author | Steven Luong <sluong@cisco.com> | 2019-07-24 11:16:46 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-07-25 09:00:41 +0000 |
commit | 0dbaa59e075f9ac44b0bd23ed2c9adbd85215e8f (patch) | |
tree | f9988bfc424f381179ea35a9700c0bf54a347ce2 | |
parent | c94afaade0a8fec724d051a202591f5b37dd0f49 (diff) |
memif: Fix uninitialized variable as reported by coverity
When mode == ip, the variable next_index is not initialized.
Although insde the while loop, ni will be fixed to contain next[0],
it is easier to initialize it.
Type: fix
Change-Id: I6653a958bbc5105e7266bf89e3c8569ff00f0199
Signed-off-by: Steven Luong <sluong@cisco.com>
-rw-r--r-- | src/plugins/memif/node.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c index a4b8245b520..154d2444957 100644 --- a/src/plugins/memif/node.c +++ b/src/plugins/memif/node.c @@ -185,7 +185,8 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, u16 nexts[MEMIF_RX_VECTOR_SZ], *next = nexts; u32 _to_next_bufs[MEMIF_RX_VECTOR_SZ], *to_next_bufs = _to_next_bufs, *bi; u32 n_rx_packets = 0, n_rx_bytes = 0; - u32 n_left, n_left_to_next, next_index; + u32 n_left, n_left_to_next; + u32 next_index = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT; vlib_buffer_t *b0, *b1, *b2, *b3; u32 thread_index = vm->thread_index; memif_per_thread_data_t *ptd = vec_elt_at_index (mm->per_thread_data, |