Re: [RFC] pci: crash on pci_unregister_driver after pci_register_driver fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 3 Sep 2013 16:06:19 -0700
Greg KH <gregkh@xxxxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux