* [PATCH] ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
@ 2012-03-16 8:54 roy.qing.li
2012-03-16 14:15 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: roy.qing.li @ 2012-03-16 8:54 UTC (permalink / raw)
To: netdev
From: RongQing.Li <roy.qing.li@gmail.com>
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.
Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
---
net/ipv6/mcast.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index b853f06..16c33e3 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -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
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
2012-03-16 8:54 [PATCH] ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu roy.qing.li
@ 2012-03-16 14:15 ` Eric Dumazet
2012-03-17 4:57 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2012-03-16 14:15 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev
Le vendredi 16 mars 2012 à 16:54 +0800, roy.qing.li@gmail.com a écrit :
> From: RongQing.Li <roy.qing.li@gmail.com>
>
> 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.
>
> Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
> ---
> net/ipv6/mcast.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> index b853f06..16c33e3 100644
> --- a/net/ipv6/mcast.c
> +++ b/net/ipv6/mcast.c
> @@ -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)
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
2012-03-16 14:15 ` Eric Dumazet
@ 2012-03-17 4:57 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-03-17 4:57 UTC (permalink / raw)
To: eric.dumazet; +Cc: roy.qing.li, netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 16 Mar 2012 07:15:53 -0700
> Le vendredi 16 mars 2012 à 16:54 +0800, roy.qing.li@gmail.com a écrit :
>> From: RongQing.Li <roy.qing.li@gmail.com>
>>
>> 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.
>>
>> Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
...
> Nice catch, bug introduced in 96b52e61be1 (ipv6: mcast: RCU conversions)
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-17 4:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 8:54 [PATCH] ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu roy.qing.li
2012-03-16 14:15 ` Eric Dumazet
2012-03-17 4:57 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).