From 165f1e49361a9a5f5936f2d582641096d0d7a2a2 Mon Sep 17 00:00:00 2001 From: Min M Xu Date: Wed, 11 Jan 2023 09:22:32 +0800 Subject: [PATCH] OvmfPkg/AcpiPlatformDxe: Use local variable in QemuFwCfgAcpi.c 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 Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Reported-by: Laszlo Ersek Reviewed-by: Laszlo Ersek Signed-off-by: Min Xu Message-Id: <20230111012235.189-4-min.m.xu@intel.com> --- OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c index 1a3852904d..9711335c6c 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -20,7 +20,6 @@ #include // gBS #include "AcpiPlatform.h" -EFI_HANDLE mQemuAcpiHandle = NULL; // // The user structure for the ordered collection that will track the fw_cfg @@ -1101,6 +1100,7 @@ InstallQemuFwCfgTables ( ORDERED_COLLECTION_ENTRY *TrackerEntry, *TrackerEntry2; ORDERED_COLLECTION *SeenPointers; ORDERED_COLLECTION_ENTRY *SeenPointerEntry, *SeenPointerEntry2; + EFI_HANDLE QemuAcpiHandle; Status = QemuFwCfgFindFile ("etc/table-loader", &FwCfgItem, &FwCfgSize); if (EFI_ERROR (Status)) { @@ -1278,8 +1278,9 @@ UninstallAcpiTables: // Install a protocol to notify that the ACPI table provided by Qemu is // ready. // + QemuAcpiHandle = NULL; gBS->InstallProtocolInterface ( - &mQemuAcpiHandle, + &QemuAcpiHandle, &gQemuAcpiTableNotifyProtocolGuid, EFI_NATIVE_INTERFACE, NULL