From: Ben Greear Date: Fri, 23 Sep 2011 13:11:01 +0000 (+0000) Subject: ipv6-multicast: Fix memory leak in IPv6 multicast. X-Git-Tag: v3.0.23~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24190a04c967d91e718bbe7a871e418edb9424aa;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 450a1ff..86e3cc1 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;