[ 37/61] ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()

From: Greg Kroah-Hartman
Date: Tue Feb 12 2013 - 16:01:43 EST

3.7-stable review patch. If anyone has any objections, please let me know.


From: Tommi Rantala <tt.rantala@xxxxxxxxx>

[ Upstream commit 41ab3e31bd50b42c85ac0aa0469642866aee2a9a ]

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@xxxxxxxxx>
Acked-by: Eric Dumazet <edumazet@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
net/ipv6/ip6_gre.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -976,7 +976,7 @@ static netdev_tx_t ip6gre_tunnel_xmit(st
int ret;

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

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

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/