Skip to content

Commit

Permalink
[PKT_SCHED]: Fix memory leak when dumping in pedit action
Browse files Browse the repository at this point in the history
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 Jan 9, 2006
1 parent 31bd06e commit 541673c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sched/pedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,12 @@ tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,int bind, int ref)
t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse);
t.expires = jiffies_to_clock_t(p->tm.expires);
RTA_PUT(skb, TCA_PEDIT_TM, sizeof(t), &t);
kfree(opt);
return skb->len;

rtattr_failure:
skb_trim(skb, b - skb->data);
kfree(opt);
return -1;
}

Expand Down

0 comments on commit 541673c

Please sign in to comment.