Skip to content

Commit 1aad804

Browse files
congwangdavem330
authored andcommitted
net_sched: remove a redundant goto chain check
All TC actions call tcf_action_check_ctrlact() to validate goto chain, so this check in tcf_action_init_1() is actually redundant. Remove it to save troubles of leaking memory. Fixes: e49d8c2 ("net_sched: defer tcf_idr_insert() in tcf_action_init_1()") Reported-by: Vlad Buslov <[email protected]> Suggested-by: Davide Caratti <[email protected]> Cc: Jamal Hadi Salim <[email protected]> Cc: Jiri Pirko <[email protected]> Signed-off-by: Cong Wang <[email protected]> Reviewed-by: Davide Caratti <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f2f3729 commit 1aad804

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

net/sched/act_api.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -722,13 +722,6 @@ int tcf_action_destroy(struct tc_action *actions[], int bind)
722722
return ret;
723723
}
724724

725-
static int tcf_action_destroy_1(struct tc_action *a, int bind)
726-
{
727-
struct tc_action *actions[] = { a, NULL };
728-
729-
return tcf_action_destroy(actions, bind);
730-
}
731-
732725
static int tcf_action_put(struct tc_action *p)
733726
{
734727
return __tcf_action_put(p, false);
@@ -1000,13 +993,6 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
1000993
if (err < 0)
1001994
goto err_mod;
1002995

1003-
if (TC_ACT_EXT_CMP(a->tcfa_action, TC_ACT_GOTO_CHAIN) &&
1004-
!rcu_access_pointer(a->goto_chain)) {
1005-
tcf_action_destroy_1(a, bind);
1006-
NL_SET_ERR_MSG(extack, "can't use goto chain with NULL chain");
1007-
return ERR_PTR(-EINVAL);
1008-
}
1009-
1010996
if (!name && tb[TCA_ACT_COOKIE])
1011997
tcf_set_action_cookie(&a->act_cookie, cookie);
1012998

0 commit comments

Comments
 (0)