diff options
author | Dmitry Popov <ixaphire@qrator.net> | 2014-06-05 20:34:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-05 21:44:44 -0400 |
commit | 586d5fc867be8f03c049b4b89fd29d0b8b02cab5 (patch) | |
tree | 8ca1d723c8c4b442f23b19dd6f189e61f445c40a /net | |
parent | 0dcceabb0c1bf2d4c12a748df9933fad303072a7 (diff) |
ip_tunnel: fix possible rtable leak
ip_rt_put(rt) is always called in "error" branches above, but was missed in
skb_cow_head branch. As rt is not yet bound to skb here we have to release it by
hand.
Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_tunnel.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 2acc2337d38b..3f6135bc54ef 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -668,6 +668,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
668 | dev->needed_headroom = max_headroom; | 668 | dev->needed_headroom = max_headroom; |
669 | 669 | ||
670 | if (skb_cow_head(skb, dev->needed_headroom)) { | 670 | if (skb_cow_head(skb, dev->needed_headroom)) { |
671 | ip_rt_put(rt); | ||
671 | dev->stats.tx_dropped++; | 672 | dev->stats.tx_dropped++; |
672 | kfree_skb(skb); | 673 | kfree_skb(skb); |
673 | return; | 674 | return; |