Netdev List
 help / color / mirror / Atom feed
* [PATCH] ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()
@ 2013-02-06 13:24 Tommi Rantala
  2013-02-06 13:29 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Tommi Rantala @ 2013-02-06 13:24 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev, Dmitry Kozlov,
	Eric Dumazet
  Cc: Tommi Rantala

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>
---
 net/ipv6/ip6_gre.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index c727e47..131dd09 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -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):
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-06 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-06 13:24 [PATCH] ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit() Tommi Rantala
2013-02-06 13:29 ` Eric Dumazet
2013-02-06 21:02   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox