ipv6-multicast: Fix memory leak in IPv6 multicast.
authorBen Greear <greearb@candelatech.com>
Fri, 23 Sep 2011 13:11:01 +0000 (13:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Sep 2011 19:34:00 +0000 (15:34 -0400)
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>
net/ipv6/ip6mr.c

index 825d02fa658678e40312c09bd778a6485be09925..def0538e24139c02e74fe466d1ca3f877fa1848a 100644 (file)
@@ -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;