diff options
author | 2017-06-16 00:59:16 -0500 | |
---|---|---|
committer | 2017-07-20 03:37:39 +0200 | |
commit | 971b2cc00e0a3c55e8811c0158aa8a76548d6eb8 (patch) | |
tree | b0f1ddab5890fb6adb8bc6277dcff3fb97176892 | |
parent | data: use KMEM_CACHE macro (diff) | |
download | wireguard-monolithic-historical-971b2cc00e0a3c55e8811c0158aa8a76548d6eb8.tar.xz wireguard-monolithic-historical-971b2cc00e0a3c55e8811c0158aa8a76548d6eb8.zip |
data: simplify no-keypair failure case
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to '')
-rw-r--r-- | src/data.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -275,9 +275,9 @@ int packet_create_data(struct sk_buff_head *queue, struct wireguard_peer *peer) rcu_read_lock_bh(); keypair = noise_keypair_get(rcu_dereference_bh(peer->keypairs.current_keypair)); - if (unlikely(!keypair)) - goto err_rcu; rcu_read_unlock_bh(); + if (unlikely(!keypair)) + return ret; skb_queue_walk (queue, skb) { if (unlikely(!get_encryption_nonce(&PACKET_CB(skb)->nonce, &keypair->sending))) @@ -328,9 +328,6 @@ serial_encrypt: err: noise_keypair_put(keypair); return ret; -err_rcu: - rcu_read_unlock_bh(); - return ret; } static void begin_decrypt_packet(struct decryption_ctx *ctx) |