Commit dbfe394d authored by Vinay Kumar Yadav's avatar Vinay Kumar Yadav Committed by Jakub Kicinski

chelsio/chtls: fix always leaking ctrl_skb

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: cc35c88a ("crypto : chtls - CPL handler definition")
Signed-off-by: default avatarVinay Kumar Yadav <vinay.yadav@chelsio.com>
Link: https://lore.kernel.org/r/20201102173909.24826-1-vinay.yadav@chelsio.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8080b462
......@@ -212,7 +212,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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment