Browse Source

[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 <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy 19 years ago
parent
commit
f6e57464df
1 changed files with 1 additions and 1 deletions
  1. 1 1
      net/sched/act_api.c

+ 1 - 1
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:
 rtattr_failure:
 nlmsg_failure:
 nlmsg_failure:
-	skb_trim(skb, b - skb->data);
+	kfree_skb(skb);
 	return -1;
 	return -1;
 }
 }