summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Kumar Yadav <vinay.yadav@chelsio.com>2020-11-02 23:09:10 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-10 12:35:54 +0100
commit75b0b05ace856333c2a94c2173c92973dd027297 (patch)
treeeef74c3db658cac309530cf21ebab64122c2c4af
parentfe478a589404287513bf4cbb074df80805db9f6f (diff)
downloadlinux-stable-75b0b05ace856333c2a94c2173c92973dd027297.tar.gz
linux-stable-75b0b05ace856333c2a94c2173c92973dd027297.tar.bz2
linux-stable-75b0b05ace856333c2a94c2173c92973dd027297.zip
chelsio/chtls: fix always leaking ctrl_skb
[ Upstream commit dbfe394dad33f99cf8458be50483ec40a5d29c34 ] Correct skb refcount in alloc_ctrl_skb(), causing skb memleak when chtls_send_abort() called with NULL skb. it was always leaking the skb, correct it by incrementing skb refs by one. Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition") Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com> Link: https://lore.kernel.org/r/20201102173909.24826-1-vinay.yadav@chelsio.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/crypto/chelsio/chtls/chtls_cm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/chelsio/chtls/chtls_cm.c b/drivers/crypto/chelsio/chtls/chtls_cm.c
index f7334c42ebd9..35116cdb5e38 100644
--- a/drivers/crypto/chelsio/chtls/chtls_cm.c
+++ b/drivers/crypto/chelsio/chtls/chtls_cm.c
@@ -175,7 +175,7 @@ static struct sk_buff *alloc_ctrl_skb(struct sk_buff *skb, int len)
{
if (likely(skb && !skb_shared(skb) && !skb_cloned(skb))) {
__skb_trim(skb, 0);
- refcount_add(2, &skb->users);
+ refcount_inc(&skb->users);
} else {
skb = alloc_skb(len, GFP_KERNEL | __GFP_NOFAIL);
}