summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2017-01-26 13:59:20 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2017-02-10 16:52:00 +0800
commit29dbdcabf98f6834d61b17e62995a203323fbd40 (patch)
tree05c67961acaa10484f685208f772a3918129bb71 /MdeModulePkg
parentc1a247b8a768e1ebda569dbe9ad7ada8bce3db26 (diff)
downloadedk2-29dbdcabf98f6834d61b17e62995a203323fbd40.zip
edk2-29dbdcabf98f6834d61b17e62995a203323fbd40.tar.gz
edk2-29dbdcabf98f6834d61b17e62995a203323fbd40.tar.bz2
MdeModulePkg/IncompatiblePci: Use MAX_UINTN to match any IDs
When the VendorId/DeviceId/RevisionId/SubsystemVendorId /SubsystemDeviceId is MAX_UINTN, IncompatiblePciDeviceSupport driver doesn't use it to match any IDs. The patch fixes this bug. Since PciBus driver always calls IncompatiblePciDeviceSupport using IDs read from HW, MAX_UINTN is never passed to this driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
index bf0d47a..149662d 100644
--- a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
+++ b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c
@@ -283,31 +283,31 @@ PCheckDevice (
//
// See if the Header matches the parameters passed in
//
- if (Header->VendorId != MAX_UINT64) {
+ if ((Header->VendorId != MAX_UINT64) && (VendorId != MAX_UINTN)) {
if (Header->VendorId != VendorId) {
continue;
}
}
- if (Header->DeviceId != MAX_UINT64) {
+ if ((Header->DeviceId != MAX_UINT64) && (DeviceId != MAX_UINTN)) {
if (DeviceId != Header->DeviceId) {
continue;
}
}
- if (Header->RevisionId != MAX_UINT64) {
+ if ((Header->RevisionId != MAX_UINT64) && (RevisionId != MAX_UINTN)) {
if (RevisionId != Header->RevisionId) {
continue;
}
}
- if (Header->SubsystemVendorId != MAX_UINT64) {
+ if ((Header->SubsystemVendorId != MAX_UINT64) && (SubsystemVendorId != MAX_UINTN)) {
if (SubsystemVendorId != Header->SubsystemVendorId) {
continue;
}
}
- if (Header->SubsystemDeviceId != MAX_UINT64) {
+ if ((Header->SubsystemDeviceId != MAX_UINT64) && (SubsystemDeviceId != MAX_UINTN)) {
if (SubsystemDeviceId != Header->SubsystemDeviceId) {
continue;
}