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>
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:
err = set_udp_port(skb, nla_data(nested_attr));
break;
}
+
return err;
}
case OVS_ACTION_ATTR_SAMPLE:
err = sample(dp, skb, a);
break;
-
}
+
if (unlikely(err)) {
kfree_skb(skb);
return err;