]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeHstiLib/HstiDxe.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / DxeHstiLib / HstiDxe.c
index c032a98647bf2b0cf443d8a5876d947275325030..9466e3dcb3a856953acef3a2d636254ef222739f 100644 (file)
@@ -1,13 +1,7 @@
 /** @file\r
 \r
-  Copyright (c) 2015, 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
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -115,7 +109,7 @@ InternalHstiFindAip (
     }\r
 \r
     Hsti = InformationBlock;\r
-    if ((Hsti->Role == Role) && \r
+    if ((Hsti->Role == Role) &&\r
         ((ImplementationID == NULL) || (StrCmp (ImplementationID, Hsti->ImplementationID) == 0))) {\r
       break;\r
     } else {\r
@@ -206,12 +200,12 @@ InternalHstiIsValidTable (
     }\r
   }\r
   if (Index == sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) {\r
-    DEBUG ((EFI_D_ERROR, "ImplementationID is no NUL CHAR\n"));\r
+    DEBUG ((EFI_D_ERROR, "ImplementationID has no NUL CHAR\n"));\r
     return FALSE;\r
   }\r
 \r
   ErrorStringSize = HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3;\r
-  ErrorString = (CHAR16 *)((UINTN)Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3);\r
+  ErrorString = (CHAR16 *)((UINTN)Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 3);\r
 \r
   //\r
   // basic check for ErrorString\r
@@ -311,7 +305,7 @@ HstiLibSetTable (
   CopyMem (&HstiAip->Aip, &mAdapterInformationProtocol, sizeof(EFI_ADAPTER_INFORMATION_PROTOCOL));\r
   HstiAip->HstiSize = HstiSize;\r
   HstiAip->HstiMaxSize = HstiSize;\r
-  \r
+\r
   Handle = NULL;\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &Handle,\r
@@ -416,6 +410,7 @@ InternalHstiRecordFeaturesVerified (
                   Hsti,\r
                   HstiSize\r
                   );\r
+  FreePool (Hsti);\r
   return Status;\r
 }\r
 \r
@@ -545,6 +540,8 @@ InternalHstiRecordErrorString (
                   NewHsti,\r
                   NewHstiSize\r
                   );\r
+  FreePool (Hsti);\r
+  FreePool (NewHsti);\r
   return Status;\r
 }\r
 \r