ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
Subsystems (3)
PATCH 1/1 ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
From: RongQing.Li <[email protected]>
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.
--- net/ipv6/mcast.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
net/ipv6/mcast.c +0 -1
@@ -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
Signature · 1 line
1.7.1
Quoted 16 lines · Le vendredi 16 mars 2012 à 16:54 +0800, [email protected] a écrit :
From: RongQing.Li <[email protected]>
ip6_mc_find_dev_rcu()is called withrcu_read_lock(), so don't need todev_hold().
Withdev_hold(), not correspondingdev_put(), will lead to leak.Signed-off-by RongQing.Li <[email protected]>--- net/ipv6/mcast.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)net/ipv6/mcast.c +0
-0
net/ipv6/mcast.c static struct inet6_dev *ip6_mc_find_dev_rcu(struct net *net, · line 262
Quoted 7 lines
net/ipv6/mcast.c +0
-1@@ -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
Nice catch, bug introduced in 96b52e61be1 (ipv6: mcast: RCU conversions)
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Fri, 16 Mar 2012 07:15:53 -0700
Quoted 8 lines · Le vendredi 16 mars 2012 à 16:54 +0800, [email protected] a écrit :
Quoted 7 lines
From: RongQing.Li <[email protected]>
ip6_mc_find_dev_rcu()is called withrcu_read_lock(), so don't need todev_hold().
Withdev_hold(), not correspondingdev_put(), will lead to leak.Signed-off-by RongQing.Li <[email protected]>
...
Quoted 3 lines
Nice catch, bug introduced in
96b52e61be1(ipv6: mcast: RCU conversions)Acked-by Eric Dumazet <[email protected]>
Applied and queued up for -stable, thanks.