summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-06-29 23:44:53 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-06-30 02:58:39 +0200
commit8c9b847669438229366417acbdd87c9e7e0ea5be (patch)
treed86b60e8acf04bd625eb3a3984d93af460fbb977
parent49668ee002a779a814c56defd8436a91424649ab (diff)
device init: free wq after padata
The padata free functions make reference to their parent workqueue, so it's important that we wait to free the workqueue after the padata. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c
index 31fae5b..ccb0af4 100644
--- a/src/device.c
+++ b/src/device.c
@@ -199,9 +199,9 @@ static void destruct(struct net_device *dev)
wg->incoming_port = 0;
destroy_workqueue(wg->workqueue);
#ifdef CONFIG_WIREGUARD_PARALLEL
- destroy_workqueue(wg->parallelqueue);
padata_free(wg->parallel_send);
padata_free(wg->parallel_receive);
+ destroy_workqueue(wg->parallelqueue);
#endif
routing_table_free(&wg->peer_routing_table);
memzero_explicit(&wg->static_identity, sizeof(struct noise_static_identity));
@@ -308,12 +308,12 @@ err:
if (wg->workqueue)
destroy_workqueue(wg->workqueue);
#ifdef CONFIG_WIREGUARD_PARALLEL
- if (wg->parallelqueue)
- destroy_workqueue(wg->parallelqueue);
if (wg->parallel_send)
padata_free(wg->parallel_send);
if (wg->parallel_receive)
padata_free(wg->parallel_receive);
+ if (wg->parallelqueue)
+ destroy_workqueue(wg->parallelqueue);
#endif
if (wg->cookie_checker.device)
cookie_checker_uninit(&wg->cookie_checker);