From: Greg KH <gregkh@linux-foundation.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: linux-pci@vger.kernel.org
Subject: Re: [RFC] pci: crash on pci_unregister_driver after pci_register_driver fails
Date: Tue, 3 Sep 2013 16:06:19 -0700 [thread overview]
Message-ID: <20130903230619.GA12729@kroah.com> (raw)
In-Reply-To: <20130903153815.13638272@nehalam.linuxnetplumber.net>
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
next prev parent reply other threads:[~2013-09-03 23:06 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 [this message]
2013-09-04 16:13 ` Stephen Hemminger
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=20130903230619.GA12729@kroah.com \
--to=gregkh@linux-foundation.org \
--cc=linux-pci@vger.kernel.org \
--cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.