]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
MdeModulePkg: remove unused variable DevicePathSize
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / ConfigRouting.c
index 1fb16817b76a6282bc2abf62a95a52737881545b..4caf361bd22272cc51c0a3de82e9305cd0ef5ee4 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Implementation of interfaces function for EFI_HII_CONFIG_ROUTING_PROTOCOL.\r
 \r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -1287,7 +1287,7 @@ IsThisVarstore (
   //\r
   // If ConfigHdr has name field and varstore not has name, return FALSE.\r
   //\r
-  if (Name == NULL && StrStr (ConfigHdr, L"NAME=&") == NULL) {\r
+  if (Name == NULL && ConfigHdr != NULL && StrStr (ConfigHdr, L"NAME=&") == NULL) {\r
     return FALSE;\r
   }\r
 \r
@@ -1432,13 +1432,11 @@ IsThisPackageList (
       // No matched varstore is found and directly return.\r
       //\r
       goto Done;\r
-      break;\r
 \r
     default:\r
       break;\r
     }\r
   }\r
-\r
 Done:\r
   if (HiiFormPackage != NULL) {\r
     FreePool (HiiFormPackage);\r
@@ -2331,6 +2329,8 @@ GetBlockElement (
   IFR_BLOCK_DATA       *NextBlockData;\r
   UINTN                Length;\r
 \r
+  TmpBuffer = NULL;\r
+\r
   //\r
   // Init RequestBlockArray\r
   //\r
@@ -3085,7 +3085,7 @@ GetFullStringFromHiiFormPackages (
 \r
   Status = GetFormPackageData (DataBaseRecord, &HiiFormPackage, &PackageSize);\r
   if (EFI_ERROR (Status)) {\r
-    return Status;\r
+    goto Done;\r
   }\r
 \r
   //\r
@@ -3771,7 +3771,7 @@ HiiConfigRoutingExtractConfig (
       if ((DevicePathPkg = Database->PackageList->DevicePathPkg) != NULL) {\r
         CurrentDevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);\r
         DevicePathSize    = GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) CurrentDevicePath);\r
-        if ((CompareMem (DevicePath,CurrentDevicePath,DevicePathSize) == 0) && IsThisPackageList(Database, Request)) {\r
+        if ((CompareMem (DevicePath,CurrentDevicePath,DevicePathSize) == 0) && IsThisPackageList(Database, ConfigRequest)) {\r
           DriverHandle = Database->DriverHandle;\r
           HiiHandle    = Database->Handle;\r
           break;\r
@@ -4278,7 +4278,7 @@ HiiConfigRoutingRouteConfig (
       if ((DevicePathPkg = Database->PackageList->DevicePathPkg) != NULL) {\r
         CurrentDevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);\r
         DevicePathSize    = GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) CurrentDevicePath);\r
-        if ((CompareMem (DevicePath,CurrentDevicePath,DevicePathSize) == 0) && IsThisPackageList(Database, Configuration)) {\r
+        if ((CompareMem (DevicePath,CurrentDevicePath,DevicePathSize) == 0) && IsThisPackageList(Database, ConfigResp)) {\r
           DriverHandle = Database->DriverHandle;\r
           break;\r
         }\r
@@ -4341,6 +4341,7 @@ HiiConfigRoutingRouteConfig (
                                );\r
     }\r
     if (EFI_ERROR (Status)) {\r
+      ASSERT (AccessProgress != NULL);\r
       //\r
       // AccessProgress indicates the parsing progress on <ConfigResp>.\r
       // Map it to the progress on <MultiConfigResp> then return it.\r
@@ -4433,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
@@ -4482,12 +4485,11 @@ HiiBlockToConfig (
   }\r
   if (*StringPtr == 0) {\r
     *Progress = StringPtr;\r
-    Status = EFI_SUCCESS;\r
 \r
     AppendToMultiString(Config, ConfigRequest);\r
     HiiToLower (*Config);\r
 \r
-    goto Exit;\r
+    return EFI_SUCCESS;\r
   }\r
   //\r
   // Skip '&'\r
@@ -4730,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