summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-09-23 13:11:01 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-29 16:33:51 -0800
commit24190a04c967d91e718bbe7a871e418edb9424aa (patch)
tree7fc9738a4ec0dcc1ced09479d7079a9dae8ad421 /net
parent23b139ecf944b097a0493262cbc04886363bd8e6 (diff)
ipv6-multicast: Fix memory leak in IPv6 multicast.
[ Upstream commit 67928c4041606f02725f3c95c4c0404e4532df1b ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-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 450a1ffdfe0b..86e3cc10fc2e 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;