Skip to content

Commit 1e7af3b

Browse files
vaverindavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ce2b7db commit 1e7af3b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/l2tp/l2tp_core.c

+4
Original file line numberDiff line numberDiff line change
@@ -1833,6 +1833,7 @@ static __net_exit void l2tp_exit_net(struct net *net)
18331833
{
18341834
struct l2tp_net *pn = l2tp_pernet(net);
18351835
struct l2tp_tunnel *tunnel = NULL;
1836+
int hash;
18361837

18371838
rcu_read_lock_bh();
18381839
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)
18421843

18431844
flush_workqueue(l2tp_wq);
18441845
rcu_barrier();
1846+
1847+
for (hash = 0; hash < L2TP_HASH_SIZE_2; hash++)
1848+
WARN_ON_ONCE(!hlist_empty(&pn->l2tp_session_hlist[hash]));
18451849
}
18461850

18471851
static struct pernet_operations l2tp_net_ops = {

0 commit comments

Comments
 (0)