On Tue, May 16, 2017 at 10:27 AM, Jiri Pirko <j...@resnulli.us> wrote:
> +int tcf_block_get(struct tcf_block **p_block,
> +                 struct tcf_proto __rcu **p_filter_chain)
> +{
> +       struct tcf_block *block = kzalloc(sizeof(*block), GFP_KERNEL);
> +
> +       if (!block)
> +               return -ENOMEM;
> +       block->p_filter_chain = p_filter_chain;
> +       *p_block = block;
> +       return 0;
> +}
> +EXPORT_SYMBOL(tcf_block_get);


XXX_get() is usually for refcnt'ing, here you only allocate
a block, so please rename it to tcf_block_alloc().


> +
> +void tcf_block_put(struct tcf_block *block)
> +{
> +       if (!block)
> +               return;
> +       tcf_destroy_chain(block->p_filter_chain);
> +       kfree(block);
> +}
> +EXPORT_SYMBOL(tcf_block_put);

Ditto, tcf_block_destroy().

Reply via email to