aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_u32.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2014-09-20 00:50:04 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-22 15:59:21 -0400
commita1ddcfee2d9ae172d0095f3f8227f7fa53288c65 (patch)
tree1403193490b5bb5373603ec13c0dd4a7c3944e56 /net/sched/cls_u32.c
parent37ab7ddf3f81cec9175f53f17c357bb0d27a343e (diff)
net: cls_u32: fix missed pcpu_success free_percpu
This fixes a missed free_percpu in the unwind code path and when keys are destroyed. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_u32.c')
-rw-r--r--net/sched/cls_u32.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 730edb29d43b..8d90e50a8ce4 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -363,6 +363,9 @@ static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n)
363#ifdef CONFIG_CLS_U32_PERF 363#ifdef CONFIG_CLS_U32_PERF
364 free_percpu(n->pf); 364 free_percpu(n->pf);
365#endif 365#endif
366#ifdef CONFIG_CLS_U32_MARK
367 free_percpu(n->pcpu_success);
368#endif
366 kfree(n); 369 kfree(n);
367 return 0; 370 return 0;
368} 371}
@@ -693,6 +696,10 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
693 696
694#ifdef CONFIG_CLS_U32_MARK 697#ifdef CONFIG_CLS_U32_MARK
695 n->pcpu_success = alloc_percpu(u32); 698 n->pcpu_success = alloc_percpu(u32);
699 if (!n->pcpu_success) {
700 err = -ENOMEM;
701 goto errout;
702 }
696 703
697 if (tb[TCA_U32_MARK]) { 704 if (tb[TCA_U32_MARK]) {
698 struct tc_u32_mark *mark; 705 struct tc_u32_mark *mark;
@@ -720,6 +727,12 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
720 *arg = (unsigned long)n; 727 *arg = (unsigned long)n;
721 return 0; 728 return 0;
722 } 729 }
730
731#ifdef CONFIG_CLS_U32_MARK
732 free_percpu(n->pcpu_success);
733#endif
734
735errout:
723#ifdef CONFIG_CLS_U32_PERF 736#ifdef CONFIG_CLS_U32_PERF
724 free_percpu(n->pf); 737 free_percpu(n->pf);
725#endif 738#endif