On 12/14/17 11:39 AM, Alexander Aring wrote:
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index 446ef956a79c..173107ed3726 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -282,20 +282,24 @@ static void tcf_block_offload_unbind(struct tcf_block 
> *block, struct Qdisc *q,
>  }
>  
>  int tcf_block_get_ext(struct tcf_block **p_block, struct Qdisc *q,
> -                   struct tcf_block_ext_info *ei)
> +                   struct tcf_block_ext_info *ei,
> +                   struct netlink_ext_ack *extack)
>  {
>       struct tcf_block *block = kzalloc(sizeof(*block), GFP_KERNEL);
>       struct tcf_chain *chain;
>       int err;
>  
> -     if (!block)
> +     if (!block) {
> +             NL_SET_ERR_MSG(extack, "No tcf block given");

Wrong message for the failure. !block means kzalloc failed.

>               return -ENOMEM;
> +     }
>       INIT_LIST_HEAD(&block->chain_list);
>       INIT_LIST_HEAD(&block->cb_list);
>  
>       /* Create chain 0 by default, it has to be always present. */
>       chain = tcf_chain_create(block, 0);
>       if (!chain) {
> +             NL_SET_ERR_MSG(extack, "Failed to create new tcf chain");
>               err = -ENOMEM;
>               goto err_chain_create;
>       }

Reply via email to