Exception due to PCI: Use pci_is_root_bus() to check for root bus

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

 



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

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