diff options
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/cls_u32.c | 13 |
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 | |||
735 | errout: | ||
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 |