]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/AcpiPlatformDxe: Use local variable in QemuFwCfgAcpi.c
authorMin M Xu <min.m.xu@intel.com>
Wed, 11 Jan 2023 01:22:32 +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

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 <lersek@redhat.com>
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>
Reported-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Message-Id: <20230111012235.189-4-min.m.xu@intel.com>

OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c

index 1a3852904df9387d03a3fd6b7a4c5c16bd2005fd..9711335c6cac3058c52cb606d48b6bf49224933d 100644 (file)
@@ -20,7 +20,6 @@
 #include <Library/UefiBootServicesTableLib.h> // gBS\r
 \r
 #include "AcpiPlatform.h"\r
-EFI_HANDLE  mQemuAcpiHandle = NULL;\r
 \r
 //\r
 // The user structure for the ordered collection that will track the fw_cfg\r
@@ -1101,6 +1100,7 @@ InstallQemuFwCfgTables (
   ORDERED_COLLECTION_ENTRY  *TrackerEntry, *TrackerEntry2;\r
   ORDERED_COLLECTION        *SeenPointers;\r
   ORDERED_COLLECTION_ENTRY  *SeenPointerEntry, *SeenPointerEntry2;\r
+  EFI_HANDLE                QemuAcpiHandle;\r
 \r
   Status = QemuFwCfgFindFile ("etc/table-loader", &FwCfgItem, &FwCfgSize);\r
   if (EFI_ERROR (Status)) {\r
@@ -1278,8 +1278,9 @@ UninstallAcpiTables:
     // Install a protocol to notify that the ACPI table provided by Qemu is\r
     // ready.\r
     //\r
+    QemuAcpiHandle = NULL;\r
     gBS->InstallProtocolInterface (\r
-           &mQemuAcpiHandle,\r
+           &QemuAcpiHandle,\r
            &gQemuAcpiTableNotifyProtocolGuid,\r
            EFI_NATIVE_INTERFACE,\r
            NULL\r