aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_cgroup.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 3b7548759998..10c7ffde13e2 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -127,16 +127,18 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
127 err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS], 127 err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS],
128 cgroup_policy); 128 cgroup_policy);
129 if (err < 0) 129 if (err < 0)
130 return err; 130 goto errout;
131 131
132 tcf_exts_init(&e, TCA_CGROUP_ACT, TCA_CGROUP_POLICE); 132 tcf_exts_init(&e, TCA_CGROUP_ACT, TCA_CGROUP_POLICE);
133 err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, ovr); 133 err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, ovr);
134 if (err < 0) 134 if (err < 0)
135 return err; 135 goto errout;
136 136
137 err = tcf_em_tree_validate(tp, tb[TCA_CGROUP_EMATCHES], &t); 137 err = tcf_em_tree_validate(tp, tb[TCA_CGROUP_EMATCHES], &t);
138 if (err < 0) 138 if (err < 0) {
139 return err; 139 tcf_exts_destroy(tp, &e);
140 goto errout;
141 }
140 142
141 tcf_exts_change(tp, &new->exts, &e); 143 tcf_exts_change(tp, &new->exts, &e);
142 tcf_em_tree_change(tp, &new->ematches, &t); 144 tcf_em_tree_change(tp, &new->ematches, &t);
@@ -145,6 +147,9 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
145 if (head) 147 if (head)
146 call_rcu(&head->rcu, cls_cgroup_destroy_rcu); 148 call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
147 return 0; 149 return 0;
150errout:
151 kfree(new);
152 return err;
148} 153}
149 154
150static void cls_cgroup_destroy(struct tcf_proto *tp) 155static void cls_cgroup_destroy(struct tcf_proto *tp)