From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7E87D81F9C for ; Wed, 25 Jan 2017 22:09:35 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 25 Jan 2017 22:09:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,287,1477983600"; d="scan'208";a="57682431" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga005.fm.intel.com with ESMTP; 25 Jan 2017 22:09:34 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Jeff Fan , Feng Tian Date: Thu, 26 Jan 2017 14:09:27 +0800 Message-Id: <20170126060927.352436-6-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20170126060927.352436-1-ruiyu.ni@intel.com> References: <20170126060927.352436-1-ruiyu.ni@intel.com> Subject: [PATCH 5/5] MdeModulePkg/IncompatiblePci: Use -1 to match any IDs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2017 06:09:35 -0000 When the VendorId/DeviceId/RevisionId/SubsystemVendorId /SubsystemDeviceId is (UINT64)-1, 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, (UINT64)-1 is never passed to this driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jeff Fan Cc: Feng Tian --- .../IncompatiblePciDeviceSupport.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c index dfb7a59..333ed56 100644 --- a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c @@ -282,31 +282,31 @@ PCheckDevice ( // // See if the Header matches the parameters passed in // - if (Header->VendorId != (UINT64)-1) { + if ((Header->VendorId != (UINT64)-1) && (VendorId != (UINT64)-1)) { if (Header->VendorId != VendorId) { continue; } } - if (Header->DeviceId != (UINT64)-1) { + if ((Header->DeviceId != (UINT64)-1) && (DeviceId != (UINT64) -1)) { if (DeviceId != Header->DeviceId) { continue; } } - if (Header->RevisionId != (UINT64)-1) { + if ((Header->RevisionId != (UINT64)-1) && (RevisionId != (UINT64) -1)) { if (RevisionId != Header->RevisionId) { continue; } } - if (Header->SubsystemVendorId != (UINT64)-1) { + if ((Header->SubsystemVendorId != (UINT64)-1) && (SubsystemVendorId != (UINT64) -1)) { if (SubsystemVendorId != Header->SubsystemVendorId) { continue; } } - if (Header->SubsystemDeviceId != (UINT64)-1) { + if ((Header->SubsystemDeviceId != (UINT64)-1) && (SubsystemDeviceId != (UINT64) -1)) { if (SubsystemDeviceId != Header->SubsystemDeviceId) { continue; } -- 2.9.0.windows.1