• B
    PCI: fix upstream P2P bridge checks when enabling OBFF and LTR · 8291550f
    Bjorn Helgaas 提交于
    pci_enable_obff() and pci_enable_ltr() incorrectly check "dev->bus" instead
    of "dev->bus->self" to determine whether the upstream device is a P2P
    bridge or a host bridge.  For devices on the root bus, the upstream device
    is a host bridge, "dev->bus != NULL" and "dev->bus->self == NULL", and we
    panic with a null pointer dereference.
    
    These functions should previously have panicked when called on devices
    supporting OBFF or LTR, so they should be regarded as untested.
    
    Found by Coverity (CID 143038 and CID 143039).
    Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
    8291550f
pci.c 101.6 KB