MdeModulePkg/EsrtFmpDxe: Support multiple devices with 0 HardwareInstance

Skip error check if HardwareInstance is 0 as this either means that
FmpVersion < 3 and not supported or,
"A zero means the FMP provider is not able to determine a
unique hardware instance number or a hardware instance number
is not needed." per UEFI specification.

As the FmpInstances are merged and HardwareInstance is not used
remove error check in this case.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
devel@edk2.groups.io 2022-12-12 11:27:26 -08:00 committed by mergify[bot]
parent f9c6b5134e
commit 090642db7a

View File

@ -153,7 +153,10 @@ CreateEsrtEntry (
// //
// Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique // Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique
// Skip if HardwareInstance is 0 as this is the case if FmpVersion < 3
// or the device can not create a unique ID per UEFI specification
// //
if (FmpHardwareInstance != 0) {
for (Index = 0; Index < *NumberOfDescriptors; Index++) { for (Index = 0; Index < *NumberOfDescriptors; Index++) {
if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImageInfoBuf->ImageTypeId)) { if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImageInfoBuf->ImageTypeId)) {
if (HardwareInstances[Index].HardwareInstance == FmpHardwareInstance) { if (HardwareInstances[Index].HardwareInstance == FmpHardwareInstance) {
@ -166,6 +169,7 @@ CreateEsrtEntry (
} }
} }
} }
}
// //
// Record new GUID/HardwareInstance pair // Record new GUID/HardwareInstance pair