summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-03 22:58:46 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-03 22:58:46 +0200
commit8a7c439c858edbd65cbf44a3a5f68581093884d2 (patch)
treecb79c7330d022388789a34e0af6e56a786c9a71e
parent11fe035b77f233a8ee5add41a9e500af948d47e9 (diff)
receive: use local keypair, not ctx keypair in error path
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/receive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/receive.c b/src/receive.c
index aab8b32..507022a 100644
--- a/src/receive.c
+++ b/src/receive.c
@@ -410,7 +410,7 @@ static void packet_consume_data(struct wireguard_device *wg, struct sk_buff *skb
ctx = kmem_cache_alloc(crypt_ctx_cache, GFP_ATOMIC);
if (unlikely(!ctx)) {
dev_kfree_skb(skb);
- peer_put(ctx->keypair->entry.peer);
+ peer_put(keypair->entry.peer);
noise_keypair_put(keypair);
return;
}