public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: roy.qing.li@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
Date: Fri, 16 Mar 2012 07:15:53 -0700	[thread overview]
Message-ID: <1331907353.2420.1.camel@edumazet-laptop> (raw)
In-Reply-To: <1331888054-21072-1-git-send-email-roy.qing.li@gmail.com>

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>

  reply	other threads:[~2012-03-16 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2012-03-17  4:57   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1331907353.2420.1.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=roy.qing.li@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox