datapath: Return correct error code when dumping flow actions.
authorJesse Gross <jesse@nicira.com>
Mon, 21 Jan 2013 11:59:17 +0000 (03:59 -0800)
committerJesse Gross <jesse@nicira.com>
Tue, 22 Jan 2013 01:33:49 +0000 (17:33 -0800)
Currently, if there isn't enough space to store the actions in a
flow during a dump we return -ENOMEM.  However, the standard error
in this situation is -EMSGSIZE so this changes the behavior to match.
This issue was introduced in 354d4c98a8cdaae3525848f564e58a9016bcd3af
 (datapath: Fix nelink attribute size for flow.).

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.c

index 0f4796e..b731c20 100644 (file)
@@ -1119,10 +1119,8 @@ static int ovs_flow_cmd_fill_info(struct sw_flow *flow, struct datapath *dp,
 
                        nla_nest_cancel(skb, start);
                }
-       } else if (skb_orig_len) {
-               err = -ENOMEM;
-               goto error;
-       }
+       } else if (skb_orig_len)
+               goto nla_put_failure;
 
        return genlmsg_end(skb, ovs_header);