summaryrefslogtreecommitdiff
path: root/net/ipv6/ip6_gre.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2019-09-13 12:45:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-21 08:16:43 +0300
commit97b5f8c95b75817f0ab27438e8dab136a3ae9ae8 (patch)
tree6f2a0511606daf318f72b91805c8c8efab167faa /net/ipv6/ip6_gre.c
parent4fb95f299504eb953d4a4fe1c58c65f26b006980 (diff)
downloadlinux-97b5f8c95b75817f0ab27438e8dab136a3ae9ae8.tar.xz
ip6_gre: fix a dst leak in ip6erspan_tunnel_xmit
[ Upstream commit 28e486037747c2180470b77c290d4090ad42f259 ] In ip6erspan_tunnel_xmit(), if the skb will not be sent out, it has to be freed on the tx_err path. Otherwise when deleting a netns, it would cause dst/dev to leak, and dmesg shows: unregister_netdevice: waiting for lo to become free. Usage count = 1 Fixes: ef7baf5e083c ("ip6_gre: add ip6 erspan collect_md mode") Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: William Tu <u9012063@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv6/ip6_gre.c')
-rw-r--r--net/ipv6/ip6_gre.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index a53ef079a539..a23516e22056 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -988,7 +988,7 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
if (unlikely(!tun_info ||
!(tun_info->mode & IP_TUNNEL_INFO_TX) ||
ip_tunnel_info_af(tun_info) != AF_INET6))
- return -EINVAL;
+ goto tx_err;
key = &tun_info->key;
memset(&fl6, 0, sizeof(fl6));