net/ipv6: stop leaking percpu memory in fib6 info
authorMike Rapoport <rppt@linux.vnet.ibm.com>
Tue, 9 Oct 2018 04:02:01 +0000 (07:02 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Oct 2018 05:42:54 +0000 (22:42 -0700)
The fib6_info_alloc() function allocates percpu memory to hold per CPU
pointers to rt6_info, but this memory is never freed. Fix it.

Fixes: a64efe142f5e ("net/ipv6: introduce fib6_info struct and helpers")
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_fib.c

index 5516f55e214bd85ff7a07cf8c24648db327902c2..cbe46175bb59df7b33403c55dd8806d0b3af7c7e 100644 (file)
@@ -196,6 +196,8 @@ void fib6_info_destroy_rcu(struct rcu_head *head)
                                *ppcpu_rt = NULL;
                        }
                }
+
+               free_percpu(f6i->rt6i_pcpu);
        }
 
        lwtstate_put(f6i->fib6_nh.nh_lwtstate);