]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/AcpiPlatformDxe: Return error if installing NotifyProtocol failed
authorMin M Xu <min.m.xu@intel.com>
Wed, 11 Jan 2023 01:22:35 +0000 (09:22 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 15 Jan 2023 10:26:15 +0000 (10:26 +0000)
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>
OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c

index 8f90ea23996dd549e7cb5593503f583f88486495..d56eb074a987e8ccba7a9e12eaf385eb9b072db2 100644 (file)
@@ -89,12 +89,16 @@ InstallCloudHvTablesTdx (
   // ready.\r
   //\r
   ChAcpiHandle = NULL;\r
-  gBS->InstallProtocolInterface (\r
-         &ChAcpiHandle,\r
-         &gQemuAcpiTableNotifyProtocolGuid,\r
-         EFI_NATIVE_INTERFACE,\r
-         NULL\r
-         );\r
+  Status       = gBS->InstallProtocolInterface (\r
+                        &ChAcpiHandle,\r
+                        &gQemuAcpiTableNotifyProtocolGuid,\r
+                        EFI_NATIVE_INTERFACE,\r
+                        NULL\r
+                        );\r
+  if (EFI_ERROR (Status)) {\r
+    ASSERT_EFI_ERROR (Status);\r
+    return Status;\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r