Skip to content

Commit 0fda760

Browse files
Florian Westphaldavem330
authored andcommitted
geneve: move debug check after netdev unregister
The debug check must be done after unregister_netdevice_many() call -- the list_del() for this is done inside .ndo_stop. Fixes: 2843a25 ("geneve: speedup geneve tunnels dismantle") Reported-and-tested-by: <[email protected]> Cc: Haishuang Yan <[email protected]> Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 61fad68 commit 0fda760

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/geneve.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,8 +1845,6 @@ static void geneve_destroy_tunnels(struct net *net, struct list_head *head)
18451845
if (!net_eq(dev_net(geneve->dev), net))
18461846
unregister_netdevice_queue(geneve->dev, head);
18471847
}
1848-
1849-
WARN_ON_ONCE(!list_empty(&gn->sock_list));
18501848
}
18511849

18521850
static void __net_exit geneve_exit_batch_net(struct list_head *net_list)
@@ -1861,6 +1859,12 @@ static void __net_exit geneve_exit_batch_net(struct list_head *net_list)
18611859
/* unregister the devices gathered above */
18621860
unregister_netdevice_many(&list);
18631861
rtnl_unlock();
1862+
1863+
list_for_each_entry(net, net_list, exit_list) {
1864+
const struct geneve_net *gn = net_generic(net, geneve_net_id);
1865+
1866+
WARN_ON_ONCE(!list_empty(&gn->sock_list));
1867+
}
18641868
}
18651869

18661870
static struct pernet_operations geneve_net_ops = {

0 commit comments

Comments
 (0)