summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/chelsio/chtls/chtls_hw.c
diff options
context:
space:
mode:
authorVinay Kumar Yadav <vinay.yadav@chelsio.com>2019-12-19 16:21:48 +0530
committerHerbert Xu <herbert@gondor.apana.org.au>2019-12-27 18:18:04 +0800
commit93e23eb2ed6c11b4f483c8111ac155ec2b1f3042 (patch)
tree0747f360fe190e3f4322fdce3ef2939f58ffc247 /drivers/crypto/chelsio/chtls/chtls_hw.c
parent596d0a289554a6946173ec898928e6390bb0943a (diff)
downloadlinux-93e23eb2ed6c11b4f483c8111ac155ec2b1f3042.tar.gz
linux-93e23eb2ed6c11b4f483c8111ac155ec2b1f3042.tar.bz2
linux-93e23eb2ed6c11b4f483c8111ac155ec2b1f3042.zip
crypto: chtls - Fixed memory leak
Freed work request skbs when connection terminates. enqueue_wr()/ dequeue_wr() is shared between softirq and application contexts, should be protected by socket lock. Moved dequeue_wr() to appropriate file. Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/chelsio/chtls/chtls_hw.c')
-rw-r--r--drivers/crypto/chelsio/chtls/chtls_hw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/chelsio/chtls/chtls_hw.c b/drivers/crypto/chelsio/chtls/chtls_hw.c
index 14d82f4e3dcf..f1820aca0d33 100644
--- a/drivers/crypto/chelsio/chtls/chtls_hw.c
+++ b/drivers/crypto/chelsio/chtls/chtls_hw.c
@@ -376,6 +376,7 @@ int chtls_setkey(struct chtls_sock *csk, u32 keylen,
kwr->sc_imm.cmd_more = cpu_to_be32(ULPTX_CMD_V(ULP_TX_SC_IMM));
kwr->sc_imm.len = cpu_to_be32(klen);
+ lock_sock(sk);
/* key info */
kctx = (struct _key_ctx *)(kwr + 1);
ret = chtls_key_info(csk, kctx, keylen, optname, cipher_type);
@@ -414,8 +415,10 @@ int chtls_setkey(struct chtls_sock *csk, u32 keylen,
csk->tlshws.txkey = keyid;
}
+ release_sock(sk);
return ret;
out_notcb:
+ release_sock(sk);
free_tls_keyid(sk);
out_nokey:
kfree_skb(skb);