@@ -437,10 +437,8 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,
f->key = handle;
f->next = NULL;
err = tcindex_filter_result_init(&f->result);
- if (err < 0) {
- kfree(f);
- goto errout_alloc;
- }
+ if (err < 0)
+ goto err_free_filter;
}
if (tb[TCA_TCINDEX_CLASSID]) {
@@ -455,10 +453,8 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,
if (old_r && old_r != r) {
err = tcindex_filter_result_init(old_r);
- if (err < 0) {
- kfree(f);
- goto errout_alloc;
- }
+ if (err < 0)
+ goto err_free_filter;
}
oldp = p;
@@ -484,6 +480,8 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,
call_rcu(&oldp->rcu, __tcindex_partial_destroy);
return 0;
+err_free_filter:
+ kfree(f);
errout_alloc:
if (balloc == 1)
tcindex_free_perfect_hash(cp);