Re: [PATCH nf-next 7/9] netfilter: nf_tables: allow large allocations for new sets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pablo,

2017-05-24 17:50 GMT+08:00 Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>:
[...]
> -       err = -ENOMEM;
> -       set = kzalloc(sizeof(*set) + size + udlen, GFP_KERNEL);
> +       alloc_size = sizeof(*set) + size + udlen;
> +       if (alloc_size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER))
> +               set = kzalloc(alloc_size, GFP_KERNEL | __GFP_NOWARN |
> +                                         __GFP_NORETRY);
>         if (set == NULL)
> +               set = vzalloc(alloc_size);

I think maybe we can use "set = kvzalloc(alloc_size, GFP_KERNEL);" to simplify
the above codes.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux