netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: David Miller <davem@davemloft.net>, tuba@ece.ufl.edu
Cc: netdev@vger.kernel.org, kuba@kernel.org, oneukum@suse.com,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] net: hso: do not call unregister if not registered
Date: Sun, 4 Oct 2020 09:14:33 +0200	[thread overview]
Message-ID: <20201004071433.GA212114@kroah.com> (raw)
In-Reply-To: <20201003.170042.489590204097552946.davem@davemloft.net>

On Sat, Oct 03, 2020 at 05:00:42PM -0700, David Miller wrote:
> From: Greg KH <gregkh@linuxfoundation.org>
> Date: Fri, 2 Oct 2020 13:43:23 +0200
> 
> > @@ -2366,7 +2366,8 @@ static void hso_free_net_device(struct hso_device *hso_dev, bool bailout)
> >  
> >  	remove_net_device(hso_net->parent);
> >  
> > -	if (hso_net->net)
> > +	if (hso_net->net &&
> > +	    hso_net->net->reg_state == NETREG_REGISTERED)
> >  		unregister_netdev(hso_net->net);
> >  
> >  	/* start freeing */
> 
> I really want to get out of the habit of drivers testing the internal
> netdev registration state to make decisions.
> 
> Instead, please track this internally.  You know if you registered the
> device or not, therefore use that to control whether you try to
> unregister it or not.

Fair enough.  Tuba, do you want to fix this up in this way, or do you
recommend that someone else do it?

thanks,

greg k-h

  reply	other threads:[~2020-10-04  7:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 11:43 [PATCH v2] net: hso: do not call unregister if not registered Greg KH
2020-10-04  0:00 ` David Miller
2020-10-04  7:14   ` Greg KH [this message]
2021-08-16  6:52     ` Salvatore Bonaccorso
2021-08-16  7:02       ` Greg KH
2021-08-17 15:19       ` Yavuz, Tuba

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=20201004071433.GA212114@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=tuba@ece.ufl.edu \
    /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;
as well as URLs for NNTP newsgroup(s).