public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@redhat.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexander Duyck <aduyck@mirantis.com>,
	Bart Van Assche <bart.vanassche@sandisk.com>
Subject: Re: [PATCH] Revert "netpoll: Fix extra refcount release in netpoll_cleanup()"
Date: Wed, 6 Apr 2016 09:48:37 -0400	[thread overview]
Message-ID: <20160406134837.GD1955@hmsreliant.think-freely.org> (raw)
In-Reply-To: <20160405205822.24724.95522.stgit@bhelgaas-glaptop2.roam.corp.google.com>

On Tue, Apr 05, 2016 at 03:58:22PM -0500, Bjorn Helgaas wrote:
> This reverts commit 543e3a8da5a4c453e992d5351ef405d5e32f27d7.
> 
> Direct callers of __netpoll_setup() depend on it to set np->dev,
> so we can't simply move that assignment up to netpoll_stup().
> 
> Reported-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  net/core/netpoll.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/core/netpoll.c b/net/core/netpoll.c
> index a57bd17..94acfc8 100644
> --- a/net/core/netpoll.c
> +++ b/net/core/netpoll.c
> @@ -603,6 +603,7 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev)
>  	const struct net_device_ops *ops;
>  	int err;
>  
> +	np->dev = ndev;
>  	strlcpy(np->dev_name, ndev->name, IFNAMSIZ);
>  	INIT_WORK(&np->cleanup_work, netpoll_async_cleanup);
>  
> @@ -669,7 +670,6 @@ int netpoll_setup(struct netpoll *np)
>  		goto unlock;
>  	}
>  	dev_hold(ndev);
> -	np->dev = ndev;
>  
>  	if (netdev_master_upper_dev_get(ndev)) {
>  		np_err(np, "%s is a slave device, aborting\n", np->dev_name);
> @@ -770,7 +770,6 @@ int netpoll_setup(struct netpoll *np)
>  	return 0;
>  
>  put:
> -	np->dev = NULL;
>  	dev_put(ndev);
>  unlock:
>  	rtnl_unlock();
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

  reply	other threads:[~2016-04-06 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 20:58 [PATCH] Revert "netpoll: Fix extra refcount release in netpoll_cleanup()" Bjorn Helgaas
2016-04-06 13:48 ` Neil Horman [this message]
2016-04-06 14:13 ` Bart Van Assche

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=20160406134837.GD1955@hmsreliant.think-freely.org \
    --to=nhorman@redhat.com \
    --cc=aduyck@mirantis.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=bhelgaas@google.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.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