summaryrefslogtreecommitdiffhomepage
path: root/src/data.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-15 20:19:20 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-15 20:19:20 +0100
commit6e71b31d5116a9260be12e855672196bcec618cb (patch)
tree07f4c09df2f716ea45f3ac4de67674158bf39f61 /src/data.c
parentd60ef8063c80b899b57fa1450ba48eb9d42a620f (diff)
various: nits from willy
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/data.c b/src/data.c
index b6d20b8..dd7f0cb 100644
--- a/src/data.c
+++ b/src/data.c
@@ -439,11 +439,9 @@ void packet_consume_data(struct sk_buff *skb, size_t offset, struct wireguard_de
ret = -EINVAL;
rcu_read_lock();
keypair = noise_keypair_get((struct noise_keypair *)index_hashtable_lookup(&wg->index_hashtable, INDEX_HASHTABLE_KEYPAIR, idx));
- if (unlikely(!keypair)) {
- rcu_read_unlock();
- goto err;
- }
rcu_read_unlock();
+ if (unlikely(!keypair))
+ goto err;
#ifdef CONFIG_WIREGUARD_PARALLEL
if (cpumask_weight(cpu_online_mask) > 1) {
unsigned int cpu = choose_cpu(idx);