From 7cd55f300915af8759bdf1687af7e3a7f4d4f13c Mon Sep 17 00:00:00 2001 From: Min M Xu Date: Wed, 11 Jan 2023 09:22:35 +0800 Subject: [PATCH] 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 Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Cc: Sebastien Boeuf Signed-off-by: Min Xu Message-Id: <20230111012235.189-7-min.m.xu@intel.com> Reviewed-by: Sebastien Boeuf --- OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c index 8f90ea2399..d56eb074a9 100644 --- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c @@ -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; } -- 2.39.2