From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCHv2 net-next 10/15] net: sch: api: add extack support in tcf_block_get Date: Thu, 14 Dec 2017 13:08:09 -0700 Message-ID: References: <20171214183905.23066-1-aring@mojatatu.com> <20171214183905.23066-11-aring@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, netdev@vger.kernel.org, kernel@mojatatu.com, David Ahern To: Alexander Aring , jhs@mojatatu.com Return-path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:42808 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707AbdLNUIL (ORCPT ); Thu, 14 Dec 2017 15:08:11 -0500 Received: by mail-pg0-f66.google.com with SMTP id e14so4136355pgr.9 for ; Thu, 14 Dec 2017 12:08:11 -0800 (PST) In-Reply-To: <20171214183905.23066-11-aring@mojatatu.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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; > }