Skip to content

Commit

Permalink
ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()
Browse files Browse the repository at this point in the history
ip6gre_tunnel_xmit() is leaking the skb when we hit this error branch,
and the -1 return value from this function is bogus. Use the error
handling we already have in place in ip6gre_tunnel_xmit() for this error
case to fix this.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tommi Rantala authored and David S. Miller committed Feb 6, 2013
1 parent 6731d20 commit 41ab3e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/ip6_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb,
int ret;

if (!ip6_tnl_xmit_ctl(t))
return -1;
goto tx_err;

switch (skb->protocol) {
case htons(ETH_P_IP):
Expand Down

0 comments on commit 41ab3e3

Please sign in to comment.