]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
net-sched: fix Action flushing return code
authorJamal Hadi Salim <hadi@cyberus.ca>
Wed, 13 Aug 2008 09:41:45 +0000 (02:41 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Aug 2008 09:41:45 +0000 (02:41 -0700)
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>
net/sched/act_api.c

index 88b57331d130d78090d5fa3b817a20c8a8eaa28b..9974b3f04f05cfe54142d7d55cd762021509c8e5 100644 (file)
@@ -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);