Skip to content

Commit

Permalink
[NET_SCHED]: act_api: fix skb leak in error path
Browse files Browse the repository at this point in the history
The skb is allocated by the function, so it needs to be freed instead
of trimmed on overrun.

Coverity #614

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 13, 2006
1 parent 406dbfc commit f6e5746
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/act_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event,

rtattr_failure:
nlmsg_failure:
skb_trim(skb, b - skb->data);
kfree_skb(skb);
return -1;
}

Expand Down

0 comments on commit f6e5746

Please sign in to comment.