linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Exception due to PCI: Use pci_is_root_bus() to check for root bus
@ 2016-04-06 11:51 David Engraf
  2016-04-06 13:35 ` Bjorn Helgaas
  0 siblings, 1 reply; 7+ messages in thread
From: David Engraf @ 2016-04-06 11:51 UTC (permalink / raw)
  To: Bjorn Helgaas, Wei Yang; +Cc: linux-pci

Hi,

I have an exception in __pci_bus_size_bridges() when pci_is_root_bus 
returns false but bus->self == NULL. My driver registers a virtual bus, 
like virtfn_add_bus(). pci_add_new_bus() is called with a parent but 
without a pci_dev. Thus bus->parent is set but bus->self is NULL. When 
__pci_bus_size_bridges() is called I get an exception at:

switch (bus->self->class >> 8)

The previous version of the code, checking for bus->self != NULL worked 
for me. I think an additional check is required to make sure we're not 
accessing a NULL pointer.

Best regards
David Engraf


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-05-11 14:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06 11:51 Exception due to PCI: Use pci_is_root_bus() to check for root bus David Engraf
2016-04-06 13:35 ` Bjorn Helgaas
2016-04-06 14:01   ` David Engraf
2016-04-25 13:04     ` [PATCH] " David Engraf
2016-04-25 16:59       ` Bjorn Helgaas
2016-05-11  7:04         ` David Engraf
2016-05-11 14:53           ` Bjorn Helgaas

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).