Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Greg KH <gregkh@linux-foundation.org>
Cc: linux-pci@vger.kernel.org
Subject: Re: [RFC] pci: crash on pci_unregister_driver after pci_register_driver fails
Date: Wed, 4 Sep 2013 09:13:02 -0700	[thread overview]
Message-ID: <20130904091302.59970bbc@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20130903230619.GA12729@kroah.com>

On Tue, 3 Sep 2013 16:06:19 -0700
Greg KH <gregkh@linux-foundation.org> wrote:

> On Tue, Sep 03, 2013 at 03:38:15PM -0700, Stephen Hemminger wrote:
> > While debugging another problem with a PCI driver, I noticed that if
> > device probe routine returns an error, the kernel will crash when module
> > is unloaded. It looks like pci_register_driver() sets drv->bus to be PCI
> > then in the module unload.
> > 
> > module_unload
> >    my_device_exit_module
> >       pci_unregister_driver
> >          bus_remove_driver
> >            OOPS
> > 
> > One way to fix this would be to have pci_register_driver clear the bus
> > flag (it has no reference) if an error was detected.
> 
> Odd, no other buses do this, why would it matter for PCI?  Maybe they
> just never fail their registering calls.
> 
> How about putting this in the driver core instead so that all busses get
> fixed?
> 
> thanks,
> 
> greg k-h

Never mind, buggy driver

      reply	other threads:[~2013-09-04 16:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 22:38 [RFC] pci: crash on pci_unregister_driver after pci_register_driver fails Stephen Hemminger
2013-09-03 23:06 ` Greg KH
2013-09-04 16:13   ` Stephen Hemminger [this message]

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=20130904091302.59970bbc@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=gregkh@linux-foundation.org \
    --cc=linux-pci@vger.kernel.org \
    /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