From 15c39847d5a81ac6328113222c0c5a7e051b55d8 Mon Sep 17 00:00:00 2001
From: Jesse Gross <jesse@nicira.com>
Date: Fri, 21 Oct 2011 15:19:33 -0700
Subject: [PATCH] datapath: Fix uninitialized variable warning.

Commit 4edb9ae90e4092f5f56b9d914d2b88783c49860d "datapath: Refactor
actions in terms of match fields." introduced a spurious warning
because the compiler thinks a value might not have been assigned to
'err'.  In practice this can't happen because we've already validated
the actions.

CC: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
---
 datapath/actions.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/datapath/actions.c b/datapath/actions.c
index 70f48eae..8ca243df 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -311,12 +311,11 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
 static int execute_set_action(struct sk_buff *skb,
 				 const struct nlattr *nested_attr)
 {
-	int err;
+	int err = 0;
 
 	switch (nla_type(nested_attr)) {
 	case OVS_KEY_ATTR_TUN_ID:
 		OVS_CB(skb)->tun_id = nla_get_be64(nested_attr);
-		err = 0;
 		break;
 
 	case OVS_KEY_ATTR_ETHERNET:
@@ -335,6 +334,7 @@ static int execute_set_action(struct sk_buff *skb,
 		err = set_udp_port(skb, nla_data(nested_attr));
 		break;
 	}
+
 	return err;
 }
 
@@ -396,8 +396,8 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
 		case OVS_ACTION_ATTR_SAMPLE:
 			err = sample(dp, skb, a);
 			break;
-
 		}
+
 		if (unlikely(err)) {
 			kfree_skb(skb);
 			return err;
-- 
2.30.2