Skip to content

Commit

Permalink
esp6: fix memleak on error path in esp6_input
Browse files Browse the repository at this point in the history
This ought to be an omission in e619492 ("esp: Fix memleaks on error
paths."). The memleak on error path in esp6_input is similar to esp_input
of esp4.

Fixes: e619492 ("esp: Fix memleaks on error paths.")
Fixes: 3f29770 ("ipsec: check return value of skb_to_sgvec always")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
  • Loading branch information
Zhen Lei authored and Steffen Klassert committed Jun 27, 2018
1 parent 86126b7 commit 7284fdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/esp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,10 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb)

sg_init_table(sg, nfrags);
ret = skb_to_sgvec(skb, sg, 0, skb->len);
if (unlikely(ret < 0))
if (unlikely(ret < 0)) {
kfree(tmp);
goto out;
}

skb->ip_summed = CHECKSUM_NONE;

Expand Down

0 comments on commit 7284fdf

Please sign in to comment.