summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@ovn.org>2018-09-27 10:26:01 -0700
committerJustin Pettit <jpettit@ovn.org>2018-09-27 10:57:09 -0700
commitdc2c9ce38748c506ac67e1adfe52eef154e6fda2 (patch)
treeea0ba17b005c3b1248c874a67a5e33955747cba5 /ofproto
parent5c6590ecbe00af7df1e66b879382b3b1c70d3516 (diff)
downloadopenvswitch-dc2c9ce38748c506ac67e1adfe52eef154e6fda2.tar.gz
ofproto-dpif-xlate.c: Fix uninitialized variable warning.
With gcc 7.3.0 a warning is given about two variables possibly being uninitialized in compose_sample_action(). The code path only allows the variables to be used if they've been initialized, so this warning is incorrect. However, this change allows a clean build. Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif-xlate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 2195ea353..84cce811b 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -3068,7 +3068,7 @@ compose_sample_action(struct xlate_ctx *ctx,
/* When meter action is not required, avoid generate sample action
* for 100% sampling rate. */
bool is_sample = probability < UINT32_MAX || meter_id != UINT32_MAX;
- size_t sample_offset, actions_offset;
+ size_t sample_offset = 0, actions_offset = 0;
if (is_sample) {
sample_offset = nl_msg_start_nested(ctx->odp_actions,
OVS_ACTION_ATTR_SAMPLE);