From: Min M Xu <min.m...@intel.com>

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

The handle of mQemuAcpiHandle is not needed for anything, beyond the
scope of the InstallQemuFwCfgTables(). So a local variable will
suffice for storing the handle.

Cc: Laszlo Ersek <ler...@redhat.com>
Cc: Erdem Aktas <erdemak...@google.com>
Cc: James Bottomley <j...@linux.ibm.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: Tom Lendacky <thomas.lenda...@amd.com>
Reported-by: Laszlo Ersek <ler...@redhat.com>
Signed-off-by: Min Xu <min.m...@intel.com>
---
 OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c 
b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
index 1a3852904df9..693cb8c8a83e 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
@@ -20,7 +20,6 @@
 #include <Library/UefiBootServicesTableLib.h> // gBS
 
 #include "AcpiPlatform.h"
-EFI_HANDLE  mQemuAcpiHandle = NULL;
 
 //
 // The user structure for the ordered collection that will track the fw_cfg
@@ -1101,6 +1100,9 @@ InstallQemuFwCfgTables (
   ORDERED_COLLECTION_ENTRY  *TrackerEntry, *TrackerEntry2;
   ORDERED_COLLECTION        *SeenPointers;
   ORDERED_COLLECTION_ENTRY  *SeenPointerEntry, *SeenPointerEntry2;
+  EFI_HANDLE                QemuAcpiHandle;
+
+  QemuAcpiHandle = NULL;
 
   Status = QemuFwCfgFindFile ("etc/table-loader", &FwCfgItem, &FwCfgSize);
   if (EFI_ERROR (Status)) {
@@ -1279,7 +1281,7 @@ UninstallAcpiTables:
     // ready.
     //
     gBS->InstallProtocolInterface (
-           &mQemuAcpiHandle,
+           &QemuAcpiHandle,
            &gQemuAcpiTableNotifyProtocolGuid,
            EFI_NATIVE_INTERFACE,
            NULL
-- 
2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98185): https://edk2.groups.io/g/devel/message/98185
Mute This Topic: https://groups.io/mt/96152530/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to