[edk2-devel] [PATCH V1 2/2] OvmfPkg/AcpiPlatformDxe: Check the status to ensure no error

sunceping cepingx.sun at intel.com
Thu Oct 19 06:21:42 UTC 2023


From: Ceping Sun <cepingx.sun at intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4568

The status of "AcpiProtocol->InstallAcpiTable" is overwritten
before it can be used, it is better to check it before overwriting.

Cc: Gerd Hoffmann <kraxel at redhat.com>
Cc: Jiewen Yao <jiewen.yao at intel.com>
Cc: Min Xu <min.m.xu at intel.com>
Signed-off-by: Ceping Sun <cepingx.sun at intel.com>
---
 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
index 24c22bb646ca..7e2adcaa82d3 100644
--- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
@@ -53,6 +53,11 @@ InstallCloudHvTablesTdx (
                                CurrentTable->Length,
                                &TableHandle
                                );
+      if (EFI_ERROR (Status)) {
+        ASSERT_EFI_ERROR (Status);
+        return Status;
+      }
+
       for (UINTN i = 0; i < CurrentTable->Length; i++) {
         DEBUG ((DEBUG_INFO, " %x", *((UINT8 *)CurrentTable + i)));
       }
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109793): https://edk2.groups.io/g/devel/message/109793
Mute This Topic: https://groups.io/mt/102055425/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list