ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
authorRongQing.Li <roy.qing.li@gmail.com>
Thu, 15 Mar 2012 22:54:14 +0000 (22:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Mar 2012 04:56:42 +0000 (21:56 -0700)
ip6_mc_find_dev_rcu() is called with rcu_read_lock(), so don't
need to dev_hold().
With dev_hold(), not corresponding dev_put(), will lead to leak.

[ bug introduced in 96b52e61be1 (ipv6: mcast: RCU conversions) ]

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/mcast.c

index b853f06cc14874759e303041426b6adc14e19abc..16c33e308121da59c61629a13fa239dada189874 100644 (file)
@@ -257,7 +257,6 @@ static struct inet6_dev *ip6_mc_find_dev_rcu(struct net *net,
 
                if (rt) {
                        dev = rt->dst.dev;
-                       dev_hold(dev);
                        dst_release(&rt->dst);
                }
        } else