From: Patrick McHardy Date: Mon, 13 Mar 2006 04:33:22 +0000 (-0800) Subject: [NET_SCHED]: act_api: fix skb leak in error path X-Git-Tag: v2.6.16~54 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6e57464df7ba0e91a23b0854adb56852dcd58a7;p=linux-2.6 [NET_SCHED]: act_api: fix skb leak in error path 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 Signed-off-by: David S. Miller --- diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 792ce59940..2ffa11c6e8 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -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; }