summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index 8195611..efd0340 100644
--- a/src/device.c
+++ b/src/device.c
@@ -204,10 +204,10 @@ static void destruct(struct net_device *dev)
{
struct wireguard_device *wg = netdev_priv(dev);
- mutex_lock(&wg->device_update_lock);
rtnl_lock();
list_del(&wg->device_list);
rtnl_unlock();
+ mutex_lock(&wg->device_update_lock);
peer_remove_all(wg); /* The final references are cleared in the below calls to destroy_workqueue. */
wg->incoming_port = 0;
destroy_workqueue(wg->handshake_receive_wq);