]> git.proxmox.com Git - mirror_edk2.git/commitdiff
RedfishPkg: fix multiple SMBIOS type 42 version issue
authorNickle Wang <nicklew@nvidia.com>
Wed, 1 Feb 2023 02:26:45 +0000 (10:26 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 6 Feb 2023 15:11:28 +0000 (15:11 +0000)
RedfishHostInterfaceDxe does not close protocol notify event in
event callback function. This could cause multiple version of
type 42 records issue if the protocol is installed more than once.
Close the event in callback function so we only create one type 42
record.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c

index 3e12e0c8b9a54f1668144389df9d9bbaf10d4724..872cf3ae0609dee164b158b9a02d9cf1f5b5b1a5 100644 (file)
@@ -7,6 +7,7 @@
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
   Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>\r
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -260,6 +261,13 @@ PlatformHostInterfaceInformationReady (
   DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion is ready\n", __FUNCTION__));\r
 \r
   RedfishCreateSmbiosTable42 ();\r
+\r
+  //\r
+  // Close event so we don't create multiple type 42 records\r
+  //\r
+  gBS->CloseEvent (Event);\r
+  mPlatformHostInterfaceReadylEvent = NULL;\r
+\r
   return;\r
 }\r
 \r