On Tue, Aug 28, 2018 at 7:25 AM Paolo Abeni <[email protected]> wrote:
>
> +int tcf_action_destroy_one(struct tc_action *a, int bind)
> +{
> + struct tc_action *actions[] = { a, NULL };
> +
> + return tcf_action_destroy(actions, bind);
> +}
Make it static.
> +
> static int tcf_action_put(struct tc_action *p)
> {
> return __tcf_action_put(p, false);
> @@ -881,17 +888,16 @@ struct tc_action *tcf_action_init_1(struct net *net,
> struct tcf_proto *tp,
> if (TC_ACT_EXT_CMP(a->tcfa_action, TC_ACT_GOTO_CHAIN)) {
> err = tcf_action_goto_chain_init(a, tp);
> if (err) {
> - struct tc_action *actions[] = { a, NULL };
> -
> - tcf_action_destroy(actions, bind);
> NL_SET_ERR_MSG(extack, "Failed to init TC action
> chain");
> + tcf_action_destroy_one(a, bind);
> return ERR_PTR(err);
> }
> }
>
> if (!tcf_action_valid(a->tcfa_action)) {
> NL_SET_ERR_MSG(extack, "invalid action value, using
> TC_ACT_UNSPEC instead");
You need to adjust this extack too.
> - a->tcfa_action = TC_ACT_UNSPEC;
> + tcf_action_destroy_one(a, bind);
> + return ERR_PTR(-EINVAL);
> }
Thanks.