aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2008-08-13 02:41:45 -0700
committerDavid S. Miller <davem@davemloft.net>2008-08-13 02:41:45 -0700
commit36723873b664fb6b5cfe06d291df948126e43f50 (patch)
treefa4fdae50b25ff2ce8dd57cc9cb59ede897d4017
parentf97017cdefefdb6a0e19266024b0c6f9fd411eeb (diff)
net-sched: fix Action flushing return code
Flushing must consistently return ENOMEM on failure of any allocation Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/act_api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 88b57331d13..9974b3f04f0 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -751,7 +751,7 @@ static int tca_action_flush(struct nlattr *nla, struct nlmsghdr *n, u32 pid)
struct nlattr *tb[TCA_ACT_MAX+1];
struct nlattr *kind;
struct tc_action *a = create_a(0);
- int err = -EINVAL;
+ int err = -ENOMEM;
if (a == NULL) {
printk("tca_action_flush: couldnt create tc_action\n");
@@ -762,7 +762,7 @@ static int tca_action_flush(struct nlattr *nla, struct nlmsghdr *n, u32 pid)
if (!skb) {
printk("tca_action_flush: failed skb alloc\n");
kfree(a);
- return -ENOBUFS;
+ return err;
}
b = skb_tail_pointer(skb);