diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-12-03 13:18:18 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-12-10 19:38:06 -0600 |
commit | 93de6901766c6821538b74a092e47780a9120fac (patch) | |
tree | 05431f12c64191c2b8784afe2001b5a0f99b1a01 /arch/powerpc | |
parent | 1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff) | |
download | op-kernel-dev-93de6901766c6821538b74a092e47780a9120fac.zip op-kernel-dev-93de6901766c6821538b74a092e47780a9120fac.tar.gz |
PCI: Check for PCI_HEADER_TYPE_BRIDGE equality, not bitmask
Bit 7 of the "Header Type" register indicates a multi-function device when
set. Bits 0-6 contain encoded values, where 0x1 indicates a PCI-PCI
bridge. It is incorrect to test this as though it were a mask.
For example, while the PCI 3.0 spec only defines values 0x0, 0x1, and 0x2,
it's conceivable that a future spec could define 0x3 to mean something
else; then tests for "(hdr_type & 0x7f) & PCI_HEADER_TYPE_BRIDGE" would
incorrectly succeed for this new 0x3 header type.
Test bits 0-6 of the Header Type for equality with PCI_HEADER_TYPE_BRIDGE.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/eeh_driver.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index 80dfe89..44bca78 100644 --- a/arch/powerpc/kernel/eeh_driver.c +++ b/arch/powerpc/kernel/eeh_driver.c @@ -400,7 +400,7 @@ static void *eeh_rmv_device(void *data, void *userdata) * support EEH. So we just care about PCI devices for * simplicity here. */ - if (!dev || (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE)) + if (!dev || (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)) return NULL; /* |