[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpVhFmMNLubEg1mbc8C9sXH-bL0r7vBmmwVvC6U-hXNjtg@mail.gmail.com>
Date: Tue, 28 Aug 2018 09:59:23 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>,
David Miller <davem@...emloft.net>,
Davide Caratti <dcaratti@...hat.com>
Subject: Re: [PATCH net 1/2] net_sched: reject unknown tcfa_action values
On Tue, Aug 28, 2018 at 7:25 AM Paolo Abeni <pabeni@...hat.com> 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.
Powered by blists - more mailing lists