Skip to content

Commit

Permalink
net-sched: fix Action flushing return code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jamal Hadi Salim authored and David S. Miller committed Aug 13, 2008
1 parent f97017c commit 3672387
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sched/act_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
Expand Down

0 comments on commit 3672387

Please sign in to comment.