FmpDevicePkg: Assert on PcdFmpDeviceImageTypeIdGuid Size Mismatch

This patch adds an assert to FmpDxe.c to catch a platform
misconfiguration of PcdFmpDeviceImageTypeIdGuid.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
This commit is contained in:
Bret Barkelew 2018-11-06 18:34:49 +00:00 committed by mergify[bot]
parent 52eb643d07
commit b7f963d570
1 changed files with 6 additions and 1 deletions

View File

@ -181,7 +181,12 @@ GetImageTypeIdGuid (
if (ImageTypeIdGuidSize == sizeof (EFI_GUID)) {
FmpDeviceLibGuid = (EFI_GUID *)PcdGetPtr (PcdFmpDeviceImageTypeIdGuid);
} else {
DEBUG ((DEBUG_WARN, "FmpDxe(%s): Fall back to ImageTypeIdGuid of gEfiCallerIdGuid\n", mImageIdName));
DEBUG ((
DEBUG_ERROR,
"FmpDxe(%s): Fall back to ImageTypeIdGuid of gEfiCallerIdGuid. FmpDxe error: misconfiguration\n",
mImageIdName
));
ASSERT (FALSE);
FmpDeviceLibGuid = &gEfiCallerIdGuid;
}
}