[NET_SCHED]: act_api: fix skb leak in error path
authorPatrick McHardy <kaber@trash.net>
Mon, 13 Mar 2006 04:33:22 +0000 (20:33 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 13 Mar 2006 04:39:36 +0000 (20:39 -0800)
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>
net/sched/act_api.c

index 792ce59940ecbeaadc806b97f13cb6a1b2a811a3..2ffa11c6e8ded50080855fe7250642ebacc8cf2f 100644 (file)
@@ -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;
 }