use zu/zd in printf to avoid warnings on 32bit
[sliver-openvswitch.git] / datapath / datapath.c
index ed3dd09..b731c20 100644 (file)
@@ -1111,13 +1111,16 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
        start = nla_nest_start(skb, OVS_FLOW_ATTR_ACTIONS);
        if (start) {
                err = actions_to_attr(sf_acts->actions, sf_acts->actions_len, skb);
-               if (err < 0 && skb_orig_len)
-                       goto error;
-               nla_nest_end(skb, start);
-       } else if (skb_orig_len) {
-               err = -ENOMEM;
-               goto error;
-       }
+               if (!err)
+                       nla_nest_end(skb, start);
+               else {
+                       if (skb_orig_len)
+                               goto error;
+
+                       nla_nest_cancel(skb, start);
+               }
+       } else if (skb_orig_len)
+               goto nla_put_failure;
 
        return genlmsg_end(skb, ovs_header);