Commit b6f147a2 authored by Zhen Lei's avatar Zhen Lei Committed by Greg Kroah-Hartman

esp6: fix memleak on error path in esp6_input

[ Upstream commit 7284fdf3 ]

This ought to be an omission in e6194923 ("esp: Fix memleaks on error
paths."). The memleak on error path in esp6_input is similar to esp_input
of esp4.

Fixes: e6194923 ("esp: Fix memleaks on error paths.")
Fixes: 3f297707 ("ipsec: check return value of skb_to_sgvec always")
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0118f86d
...@@ -651,8 +651,10 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb) ...@@ -651,8 +651,10 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)
sg_init_table(sg, nfrags); sg_init_table(sg, nfrags);
ret = skb_to_sgvec(skb, sg, 0, skb->len); ret = skb_to_sgvec(skb, sg, 0, skb->len);
if (unlikely(ret < 0)) if (unlikely(ret < 0)) {
kfree(tmp);
goto out; goto out;
}
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
......
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