summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6mr.c
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-09-23 15:11:01 +0200
committerDavid S. Miller <davem@davemloft.net>2011-09-27 21:34:00 +0200
commit67928c4041606f02725f3c95c4c0404e4532df1b (patch)
tree52e69d8e283dc0efe3f6b406ce996cc999bc1e78 /net/ipv6/ip6mr.c
parentipv6: check return value for dst_alloc (diff)
downloadlinux-67928c4041606f02725f3c95c4c0404e4532df1b.tar.xz
linux-67928c4041606f02725f3c95c4c0404e4532df1b.zip
ipv6-multicast: Fix memory leak in IPv6 multicast.
If reg_vif_xmit cannot find a routing entry, be sure to free the skb before returning the error. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv6/ip6mr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 825d02fa6586..def0538e2413 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -696,8 +696,10 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb,
int err;
err = ip6mr_fib_lookup(net, &fl6, &mrt);
- if (err < 0)
+ if (err < 0) {
+ kfree_skb(skb);
return err;
+ }
read_lock(&mrt_lock);
dev->stats.tx_bytes += skb->len;