In EsrtFmp.c, function CreateEsrtEntry, line 196, the code asserts if the FMP 
image hardware instance matches that of an existing instance.  This is fine if 
the hardware instance is supported.  The field is optional though.  In the UEFI 
spec, "a zero hardware instance means the FMP provider is not able to determine 
a unique hardware instance number or a hardware instance number is not needed." 
 The code below needs to also check if the hardware instance is supported (by 
comparing it to zero) before checking it against existing entries.

 //
 // Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique
 //
 for (Index = 0; Index < *NumberOfDescriptors; Index++) {
   if ( CompareGuid (&HardwareInstances[Index].ImageTypeGuid, 
&FmpImageInfoBuf->ImageTypeId)) {
     if (HardwareInstances[Index].HardwareInstance == FmpHardwareInstance) {
       DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Duplicate firmware image descriptor 
with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf->ImageTypeId, 
FmpHardwareInstance));
       ASSERT (
         ! CompareGuid (&HardwareInstances[Index].ImageTypeGuid, 
&FmpImageInfoBuf->ImageTypeId) ||
         HardwareInstances[Index].HardwareInstance != FmpHardwareInstance
         );
       return EFI_UNSUPPORTED;
     }
   }
 }

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48306): https://edk2.groups.io/g/devel/message/48306
Mute This Topic: https://groups.io/mt/34350126/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to