Skip to content

Commit a4ffb98

Browse files
lxingregkh
authored andcommitted
ip6_gre: fix a dst leak in ip6erspan_tunnel_xmit
[ Upstream commit 28e4860 ] 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: ef7baf5 ("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>
1 parent 80691af commit a4ffb98

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/ipv6/ip6_gre.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
968968
if (unlikely(!tun_info ||
969969
!(tun_info->mode & IP_TUNNEL_INFO_TX) ||
970970
ip_tunnel_info_af(tun_info) != AF_INET6))
971-
return -EINVAL;
971+
goto tx_err;
972972

973973
key = &tun_info->key;
974974
memset(&fl6, 0, sizeof(fl6));

0 commit comments

Comments
 (0)