On 4/30/19 12:40 AM, Ido Schimmel wrote:
> On Mon, Apr 29, 2019 at 09:16:17AM -0700, David Ahern wrote:
>> /* Release a nexthop info record */
>> @@ -491,9 +491,15 @@ int fib_nh_common_init(struct fib_nh_common *nhc,
>> struct nlattr *encap,
>> u16 encap_type, void *cfg, gfp_t gfp_flags,
>> struct netlink_ext_ack *extack)
>> {
>> + int err;
>> +
>> + nhc->nhc_pcpu_rth_output = alloc_percpu_gfp(struct rtable __rcu *,
>> + gfp_flags);
>> + if (!nhc->nhc_pcpu_rth_output)
>> + return -ENOMEM;
>> +
>> if (encap) {
>> struct lwtunnel_state *lwtstate;
>> - int err;
>>
>> if (encap_type == LWTUNNEL_ENCAP_NONE) {
>> NL_SET_ERR_MSG(extack, "LWT encap type not specified");
>
> Failure here will leak 'nhc->nhc_pcpu_rth_output'
>
ugh, thanks for catching that.