From 61b8632f8e1191723d5efe4c2d198ec8e2f7db8b Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Wed, 16 Nov 2022 08:13:49 -0800 Subject: [PATCH] Fix unitialized variable found in clang compiler experiments (#108) Fix a uninitialized variable usage case found when experimenting with new clang compiler configuration. If the first `goto exit` statement is used then a comparison will be done against the uninitialized value of the variable --- MsCorePkg/AcpiRGRT/AcpiRgrt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MsCorePkg/AcpiRGRT/AcpiRgrt.c b/MsCorePkg/AcpiRGRT/AcpiRgrt.c index ad863d5f26..153346f942 100644 --- a/MsCorePkg/AcpiRGRT/AcpiRgrt.c +++ b/MsCorePkg/AcpiRGRT/AcpiRgrt.c @@ -52,6 +52,8 @@ InstallAcpiTable ( UINT32 RgrtTableSize; UINT64 OemTableId; + RgrtAcpiTable = NULL; + Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTable); if (EFI_ERROR (Status)) { // we are expected to be called at least once before ACPI is installed