diff options
Diffstat (limited to 'net/tipc/crypto.c')
-rw-r--r-- | net/tipc/crypto.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index 76b8428c94a7..e5c43d4d5a75 100644 --- a/net/tipc/crypto.c +++ b/net/tipc/crypto.c @@ -1943,12 +1943,13 @@ static void tipc_crypto_rcv_complete(struct net *net, struct tipc_aead *aead, goto rcv; if (tipc_aead_clone(&tmp, aead) < 0) goto rcv; + WARN_ON(!refcount_inc_not_zero(&tmp->refcnt)); if (tipc_crypto_key_attach(rx, tmp, ehdr->tx_key, false) < 0) { tipc_aead_free(&tmp->rcu); goto rcv; } tipc_aead_put(aead); - aead = tipc_aead_get((struct tipc_aead __force __rcu *)tmp); + aead = tmp; } if (unlikely(err)) { |