aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-09-19 06:04:01 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-09-19 06:15:27 +0200
commit2072075f89295edf523b43fe87a600625693892b (patch)
tree638d91f3b30a7241d712838875b7b36ad9362505 /src/send.c
parentqueueing: no need to memzero struct (diff)
downloadwireguard-monolithic-historical-2072075f89295edf523b43fe87a600625693892b.tar.xz
wireguard-monolithic-historical-2072075f89295edf523b43fe87a600625693892b.zip
send: don't take uninitialized lock
Packets is a local, which means we need to use the functions that don't take a spinlock, since otherwise we'll be using a spinlock in an undefined state.
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/send.c b/src/send.c
index e9fe881..107e5f6 100644
--- a/src/send.c
+++ b/src/send.c
@@ -231,7 +231,7 @@ static void packet_create_data(struct wireguard_peer *peer, struct sk_buff_head
ctx = kmem_cache_alloc(crypt_ctx_cache, GFP_ATOMIC);
if (unlikely(!ctx)) {
- skb_queue_purge(packets);
+ __skb_queue_purge(packets);
goto err_drop_refs;
}
/* This function consumes the passed references to peer and keypair. */
@@ -243,7 +243,7 @@ static void packet_create_data(struct wireguard_peer *peer, struct sk_buff_head
if (likely(queue_enqueue_per_device_and_peer(&wg->encrypt_queue, &peer->tx_queue, ctx, wg->packet_crypt_wq, &wg->encrypt_queue.last_cpu)))
return; /* Successful. No need to fall through to drop references below. */
- skb_queue_purge(&ctx->packets);
+ __skb_queue_purge(&ctx->packets);
kmem_cache_free(crypt_ctx_cache, ctx);
err_drop_refs:
@@ -288,7 +288,7 @@ void packet_send_staged_packets(struct wireguard_peer *peer)
goto out_invalid;
}
- /* We pass off our peer and keypair references too the data subsystem and return. */
+ /* We pass off our peer and keypair references to the data subsystem and return. */
packet_create_data(peer_rcu_get(peer), &packets, keypair);
return;