Commit 1e7af3b2 authored by Vasily Averin's avatar Vasily Averin Committed by David S. Miller

l2tp: exit_net cleanup check added

Be sure that l2tp_session_hlist array initialized in net_init hook
was return to initial state.
Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ce2b7db3
...@@ -1833,6 +1833,7 @@ static __net_exit void l2tp_exit_net(struct net *net) ...@@ -1833,6 +1833,7 @@ static __net_exit void l2tp_exit_net(struct net *net)
{ {
struct l2tp_net *pn = l2tp_pernet(net); struct l2tp_net *pn = l2tp_pernet(net);
struct l2tp_tunnel *tunnel = NULL; struct l2tp_tunnel *tunnel = NULL;
int hash;
rcu_read_lock_bh(); rcu_read_lock_bh();
list_for_each_entry_rcu(tunnel, &pn->l2tp_tunnel_list, list) { list_for_each_entry_rcu(tunnel, &pn->l2tp_tunnel_list, list) {
...@@ -1842,6 +1843,9 @@ static __net_exit void l2tp_exit_net(struct net *net) ...@@ -1842,6 +1843,9 @@ static __net_exit void l2tp_exit_net(struct net *net)
flush_workqueue(l2tp_wq); flush_workqueue(l2tp_wq);
rcu_barrier(); rcu_barrier();
for (hash = 0; hash < L2TP_HASH_SIZE_2; hash++)
WARN_ON_ONCE(!hlist_empty(&pn->l2tp_session_hlist[hash]));
} }
static struct pernet_operations l2tp_net_ops = { static struct pernet_operations l2tp_net_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment