]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update code to support VS2013 tool chain.
authorEric Dong <eric.dong@intel.com>
Mon, 28 Jul 2014 07:52:57 +0000 (07:52 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 28 Jul 2014 07:52:57 +0000 (07:52 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15695 6f19259b-4bc3-4df7-8a09-765794883524

23 files changed:
MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c
MdeModulePkg/Core/Dxe/Hand/DriverSupport.c
MdeModulePkg/Core/Dxe/Hand/Locate.c
MdeModulePkg/Core/Dxe/Image/Image.c
MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c
MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.c
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlChild.c
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AmlNamespace.c
MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
MdeModulePkg/Universal/EbcDxe/EbcExecute.c
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c
MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
MdeModulePkg/Universal/Variable/RuntimeDxe/Reclaim.c
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c

index a70e2e45d581aecb65f19f768ad771f9b3a055ff..c378ca5b4c1832215a645fa8920c2ecc883b8176 100644 (file)
@@ -26,7 +26,7 @@
   Depex - Dependency Expresion.\r
   SOR   - Schedule On Request - Don't schedule if this bit is set.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1142,6 +1142,8 @@ CoreFwVolEventProtocolNotify (
   VOID                          *DepexBuffer;\r
   KNOWN_HANDLE                  *KnownHandle;\r
 \r
+  FvHandle = NULL;\r
+\r
   while (TRUE) {\r
     BufferSize = sizeof (EFI_HANDLE);\r
     Status = CoreLocateHandle (\r
index e5405b325bb43c0b5b73df361d02c042d7eb6283..034520c5c6d33535f49bd223c633169bacb48c52 100644 (file)
@@ -3,7 +3,7 @@
   the Dxe Core. The mArchProtocols[] array represents a list of\r
   events that represent the Architectural Protocols.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -122,6 +122,8 @@ GenericProtocolNotify (
   LIST_ENTRY                      *Link;\r
   LIST_ENTRY                      TempLinkNode;\r
 \r
+  Protocol = NULL;\r
+\r
   //\r
   // Get Entry from Context\r
   //\r
index 92218ee7aaf39ca994616368ef5dd185b30a6357..33dd0bd0b7ca807b0831a749ecc8ac42bcc2b0f3 100644 (file)
@@ -416,6 +416,8 @@ CoreConnectSingleController (
   DriverBindingHandleBuffer             = NULL;\r
   NumberOfSortedDriverBindingProtocols  = 0;\r
   SortedDriverBindingProtocols          = NULL;\r
+  PlatformDriverOverride                = NULL;\r
+  NewDriverBindingHandleBuffer          = NULL;\r
 \r
   //\r
   // Get list of all Driver Binding Protocol Instances\r
index d4bc63c2ee7084cf81b603facff2402be263d8be..d98b55ab9363b7951dd73fd1dad9d7592867d5df 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Locate handle functions\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -449,6 +449,7 @@ CoreLocateDevicePath (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  Handles = NULL;\r
   BestDevice = NULL;\r
   SourcePath = *DevicePath;\r
   TmpDevicePath = SourcePath;\r
index 8a3e869be669747f6702bf3342c43a0ccbc6fd64..e7ad450db5d68f90d25a9fa1aff1f2416419ecdc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Core image handling services to load and unload PeImage.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -854,6 +854,9 @@ CoreUnloadAndCloseImage (
   UINTN                               OpenInfoCount;\r
   UINTN                               OpenInfoIndex;\r
 \r
+  HandleBuffer = NULL;\r
+  ProtocolGuidArray = NULL;\r
+\r
   if (Image->Ebc != NULL) {\r
     //\r
     // If EBC protocol exists we must perform cleanups for this image.\r
index ad3f58fa21a5beaa17ad29401859685bd6030b8b..e5e3926e3a0b3e11221f1e4b84f22d0da96610ea 100644 (file)
@@ -27,7 +27,7 @@
   3) A support protocol is not found, and the data is not available to be read\r
      without it.  This results in EFI_PROTOCOL_ERROR.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -513,6 +513,8 @@ VerifyGuidedSectionGuid (
   VOID                  *Interface;\r
   EFI_STATUS            Status;\r
 \r
+  Interface = NULL;\r
+\r
   //\r
   // Check if there is the Guided Section GUID configuration table recorded the GUID itself.\r
   //\r
@@ -1229,6 +1231,7 @@ GetSection (
   EFI_COMMON_SECTION_HEADER                             *Section;\r
 \r
 \r
+  ChildStreamNode = NULL;\r
   OldTpl = CoreRaiseTpl (TPL_NOTIFY);\r
   Instance = SectionInstance + 1;\r
 \r
index bbb755fa2f65cec1e698f93405664f9634b8a90b..766a3d033f582ef9bebcf631afc3ea180e8ac29b 100644 (file)
@@ -2,7 +2,7 @@
   Support routines for memory allocation routines based \r
   on boot services for Dxe phase drivers.\r
 \r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -375,6 +375,8 @@ InternalAllocatePool (
   EFI_STATUS  Status;\r
   VOID        *Memory;\r
 \r
+  Memory = NULL;\r
+\r
   Status = CoreAllocatePool (MemoryType, AllocationSize, &Memory);\r
   if (EFI_ERROR (Status)) {\r
     Memory = NULL;\r
index a6372ed752a62bce0a58f345941da1a73667f32e..f0f48438f4581e2ca8411e6007c0ddb425d15ff4 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support routines for memory allocation routines based on SMM Core internal functions.\r
 \r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -478,6 +478,8 @@ InternalAllocatePool (
   EFI_STATUS  Status;\r
   VOID        *Memory;\r
 \r
+  Memory = NULL;\r
+\r
   Status = SmmAllocatePool (MemoryType, AllocationSize, &Memory);\r
   if (EFI_ERROR (Status)) {\r
     Memory = NULL;\r
index 6146a1a309aacf519076cc54548bad8a2f3f6fcc..93f26606d0ed35786170535906579689e7ee23e1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Sdt Protocol Driver\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -852,6 +852,7 @@ SdtFindPathFromNonRoot (
   VOID                *Buffer;\r
   EFI_STATUS          Status;\r
 \r
+  Buffer = NULL;\r
   AmlHandle = (EFI_AML_HANDLE *)HandleIn;\r
 \r
   //\r
@@ -912,6 +913,7 @@ SdtFindPathFromRoot (
   EFI_STATUS          Status;\r
   VOID                *Buffer;\r
 \r
+  Buffer = NULL;\r
   AmlHandle = (EFI_AML_HANDLE *)HandleIn;\r
 \r
   //\r
index d663feaecba79d59d1a62f3872031c2c8e542553..c7e8af96d3d5f38fa540baddebf95836279f0e8b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Sdt Protocol Driver\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -189,6 +189,8 @@ AmlGetChildFromObjectChildList (
   EFI_STATUS          Status;\r
   UINT8               *CurrentBuffer;\r
 \r
+  CurrentBuffer = NULL;\r
+\r
   if ((AmlParentHandle->AmlByteEncoding->Attribute & AML_HAS_CHILD_OBJ) == 0) {\r
     //\r
     // No ObjectList\r
index b62256e388f24260600bfefb76ec0f154fce3d25..03b7394c4d0d432aa32d12a641fd5bd78cafed53 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI Sdt Protocol Driver\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -300,6 +300,8 @@ AmlConstructNodeListForChild (
   EFI_AML_HANDLE      *AmlChildHandle;\r
   EFI_STATUS          Status;\r
 \r
+  CurrentBuffer   = NULL;\r
+  AmlChildHandle  = NULL;\r
   AmlByteEncoding = AmlHandle->AmlByteEncoding;\r
   Buffer          = AmlHandle->Buffer;\r
   BufferSize      = AmlHandle->Size;\r
index 84c6c9af1f13208eb419f09df70fbb1aeae3dbfc..204c043ff45e9617935f68aadb8ef9f9e1f72079 100644 (file)
@@ -671,6 +671,7 @@ AppendAltCfgString (
   UINTN                               ValueWidth;\r
   EFI_STATUS                          Status;\r
 \r
+  TmpBuffer = NULL;\r
   StringPtr = *RequestResult;\r
   StringPtr = StrStr (StringPtr, L"OFFSET");\r
   BlockSize = sizeof (DRIVER_SAMPLE_CONFIGURATION);\r
index 29ff464a466dfef7d15cd4fab9243443fb2827f6..69aee07ea9f3414b1d43333c92726ff2a7de8cee 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Contains code that implements the virtual machine.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1827,6 +1827,7 @@ ExecuteBREAK (
   UINT64      U64EbcEntryPoint;\r
   INT32       Offset;\r
 \r
+  Thunk = NULL;\r
   Operands = GETOPERANDS (VmPtr);\r
   switch (Operands) {\r
   //\r
index 1235bd87f43473389d65fd6c85a26af02f34236b..f5707292730d65187d2be8e7f2c53d7d51a27a88 100644 (file)
@@ -40,7 +40,7 @@
   If one of them is not satisfied, FtwWrite may fail.\r
   Usually, Spare area only takes one block. That's SpareAreaLength = BlockSize, NumberOfSpareBlock = 1.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -227,6 +227,8 @@ FaultTolerantWriteInitialize (
   EFI_STATUS                              Status;\r
   EFI_FTW_DEVICE                          *FtwDevice;\r
 \r
+  FtwDevice = NULL;\r
+\r
   //\r
   // Allocate private data structure for FTW protocol and do some initialization\r
   //\r
index 2b3a63081dce9af81762253591d4801873c91c81..82219804d1196d682d28a6feec4657f068e6fdde 100644 (file)
@@ -43,7 +43,7 @@
   Caution: This module requires additional review when modified.\r
   This driver need to make sure the CommBuffer is not in the SMRAM range. \r
 \r
-Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -274,6 +274,8 @@ GetFvbByAddressAndAttribute (
   EFI_FVB_ATTRIBUTES_2                FvbAttributes;\r
   EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  *Fvb;\r
 \r
+  HandleBuffer = NULL;\r
+\r
   //\r
   // Locate all handles of SMM Fvb protocol.\r
   //\r
index b3352bbe070d03510200ae69bf0f96cf89fceb65..b24d66dde374397261a25eda13abf3948b3d2dd9 100644 (file)
@@ -2,7 +2,7 @@
 \r
   Internal generic functions to operate flash block.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -164,6 +164,7 @@ GetFvbByAddress (
 \r
   *FvBlock  = NULL;\r
   FvbHandle = NULL;\r
+  HandleBuffer = NULL;\r
   //\r
   // Locate all handles of Fvb protocol\r
   //\r
@@ -1019,6 +1020,8 @@ FindFvbForFtw (
   EFI_FV_BLOCK_MAP_ENTRY              *FvbMapEntry;\r
   UINT32                              LbaIndex;\r
 \r
+  HandleBuffer = NULL;\r
+\r
   //\r
   // Get all FVB handle.\r
   //\r
index f5e054d26577ab9bfa1dab1895fab96d26a242ba..4caf361bd22272cc51c0a3de82e9305cd0ef5ee4 100644 (file)
@@ -2329,6 +2329,8 @@ GetBlockElement (
   IFR_BLOCK_DATA       *NextBlockData;\r
   UINTN                Length;\r
 \r
+  TmpBuffer = NULL;\r
+\r
   //\r
   // Init RequestBlockArray\r
   //\r
@@ -4432,6 +4434,8 @@ HiiBlockToConfig (
   CHAR16                              *TemString;\r
   CHAR16                              TemChar;\r
 \r
+  TmpBuffer = NULL;\r
+\r
   if (This == NULL || Progress == NULL || Config == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -4728,6 +4732,8 @@ HiiConfigToBlock (
   UINTN                               BufferSize;\r
   UINTN                               MaxBlockSize;\r
 \r
+  TmpBuffer = NULL;\r
+\r
   if (This == NULL || BlockSize == NULL || Progress == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
index 01d7f02234ad30700f8fc6412e7699285f6e3da9..70c0385d88990c7fc875ebbc025664480f12567c 100644 (file)
@@ -2417,9 +2417,14 @@ AddPackages (
   //\r
   // Initialize Variables\r
   //\r
-  StringPkgIsAdd = FALSE;\r
-  FontPackage = NULL;\r
-  StringPackage = NULL;\r
+  StringPkgIsAdd        = FALSE;\r
+  FontPackage           = NULL;\r
+  StringPackage         = NULL;\r
+  GuidPackage           = NULL;\r
+  FormPackage           = NULL;\r
+  ImagePackage          = NULL;\r
+  SimpleFontPackage     = NULL;\r
+  KeyboardLayoutPackage = NULL;\r
 \r
   //\r
   // Process the package list header\r
index 60131b32db9891f384bfe4253143c7eab4205690..cb1f79b16aa3e6dc11a33d8c88822da62cbdab99 100644 (file)
@@ -393,6 +393,8 @@ IScsiReceiveLoginRsp (
   EFI_STATUS  Status;\r
   NET_BUF     *Pdu;\r
 \r
+  Pdu = NULL;\r
+\r
   //\r
   // Receive the iSCSI login response.\r
   //\r
index 1077b06669adbbb7d94319649560f89ba8d9eb36..3b0172d1245ddfffa225b640d2d5e0b348a17ba8 100644 (file)
@@ -2372,6 +2372,8 @@ EvaluateExpression (
   EFI_HII_VALUE           QuestionVal;\r
   EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
 \r
+  StrPtr = NULL;\r
+\r
   //\r
   // Save current stack offset.\r
   //\r
index 1732a0cd69922303731e1f1a6f02c4be3d94af97..44c56e232f891dadeb73f5cb619b0d1d1d46afb8 100644 (file)
@@ -3,7 +3,7 @@
   Handles non-volatile variable store garbage collection, using FTW\r
   (Fault Tolerant Write) protocol.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -47,6 +47,7 @@ GetLbaAndOffsetByAddress (
   EFI_FV_BLOCK_MAP_ENTRY              *FvbMapEntry;\r
   UINT32                              LbaIndex;\r
 \r
+  Fvb     = NULL;\r
   *Lba    = (EFI_LBA) (-1);\r
   *Offset = 0;\r
   \r
index 7bd9ffb6c5d406b1b566f3a7030f19b3725c7e2f..9101da37a666ad3e717a8b771a652f8f97434cb4 100644 (file)
@@ -3344,6 +3344,9 @@ GetFvbInfoByAddress (
   EFI_FIRMWARE_VOLUME_HEADER              *FwVolHeader;\r
   EFI_FVB_ATTRIBUTES_2                    Attributes;\r
  \r
+  Fvb = NULL;\r
+  HandleBuffer = NULL;\r
+\r
   //\r
   // Get all FVB handles.\r
   //\r
index e7b10149fb15fc791577dff78e521c87e3eaa2e6..7ca3326a887b0a323e60d33f2c5dda8fce51a9a3 100644 (file)
@@ -4,7 +4,7 @@
   and volatile storage space and install variable architecture protocol\r
   based on SMM variable module.\r
 \r
-Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -195,6 +195,7 @@ VariableLockRequestToLock (
   }\r
 \r
   VariableNameSize = StrSize (VariableName);\r
+  VariableToLock   = NULL;\r
 \r
   //\r
   // If VariableName exceeds SMM payload limit. Return failure\r
@@ -272,6 +273,7 @@ RuntimeServiceGetVariable (
 \r
   TempDataSize          = *DataSize;\r
   VariableNameSize      = StrSize (VariableName);\r
+  SmmVariableHeader     = NULL;\r
 \r
   //\r
   // If VariableName exceeds SMM payload limit. Return failure\r
@@ -374,6 +376,7 @@ RuntimeServiceGetNextVariableName (
 \r
   OutVariableNameSize   = *VariableNameSize;\r
   InVariableNameSize    = StrSize (VariableName);\r
+  SmmGetNextVariableName = NULL;\r
 \r
   //\r
   // If input string exceeds SMM payload limit. Return failure\r
@@ -491,6 +494,7 @@ RuntimeServiceSetVariable (
   }\r
 \r
   VariableNameSize      = StrSize (VariableName);\r
+  SmmVariableHeader     = NULL;\r
 \r
   //\r
   // If VariableName or DataSize exceeds SMM payload limit. Return failure\r
@@ -561,6 +565,8 @@ RuntimeServiceQueryVariableInfo (
   UINTN                                     PayloadSize;\r
   SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO *SmmQueryVariableInfo;\r
 \r
+  SmmQueryVariableInfo = NULL;\r
+\r
   if(MaximumVariableStorageSize == NULL || RemainingVariableStorageSize == NULL || MaximumVariableSize == NULL || Attributes == 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r