OvmfPkg/AcpiPlatformDxe: Return error if installing NotifyProtocol failed

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4237

Installation of gQemuAcpiTableNotifyProtocol may fail. The error code
should be returned so that the caller can handle it.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Message-Id: <20230111012235.189-7-min.m.xu@intel.com>
Reviewed-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Min M Xu 2023-01-11 09:22:35 +08:00 committed by mergify[bot]
parent 66f18fde49
commit 7cd55f3009
1 changed files with 10 additions and 6 deletions

View File

@ -89,12 +89,16 @@ InstallCloudHvTablesTdx (
// ready.
//
ChAcpiHandle = NULL;
gBS->InstallProtocolInterface (
&ChAcpiHandle,
&gQemuAcpiTableNotifyProtocolGuid,
EFI_NATIVE_INTERFACE,
NULL
);
Status = gBS->InstallProtocolInterface (
&ChAcpiHandle,
&gQemuAcpiTableNotifyProtocolGuid,
EFI_NATIVE_INTERFACE,
NULL
);
if (EFI_ERROR (Status)) {
ASSERT_EFI_ERROR (Status);
return Status;
}
return EFI_SUCCESS;
}