diff options
author | Vasily Averin <vvs@virtuozzo.com> | 2017-11-12 22:30:31 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-14 15:45:53 +0900 |
commit | 1e7af3b2cdf2dc9e4fd86c799414b3c504975270 (patch) | |
tree | e5d20db4bf806662a6e2b2b954d47b6123d237ab /net/l2tp | |
parent | ce2b7db38af1ffefa6b04b5113b4d69ad36d38ba (diff) | |
download | linux-1e7af3b2cdf2dc9e4fd86c799414b3c504975270.tar.bz2 |
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: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp')
-rw-r--r-- | net/l2tp/l2tp_core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 350fcd39ebd8..115918ad8eca 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -1833,6 +1833,7 @@ static __net_exit void l2tp_exit_net(struct net *net) { struct l2tp_net *pn = l2tp_pernet(net); struct l2tp_tunnel *tunnel = NULL; + int hash; rcu_read_lock_bh(); 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) flush_workqueue(l2tp_wq); 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 = { |