X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FDxeHstiLib%2FHstiDxe.c;h=9466e3dcb3a856953acef3a2d636254ef222739f;hb=9344f0921518309295da89c221d10cbead8531aa;hp=c032a98647bf2b0cf443d8a5876d947275325030;hpb=d3858e1006f3b88cb510f7c71452a53ff6f75c05;p=mirror_edk2.git diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiLib/HstiDxe.c index c032a98647..9466e3dcb3 100644 --- a/MdePkg/Library/DxeHstiLib/HstiDxe.c +++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c @@ -1,13 +1,7 @@ /** @file - Copyright (c) 2015, Intel Corporation. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -115,7 +109,7 @@ InternalHstiFindAip ( } Hsti = InformationBlock; - if ((Hsti->Role == Role) && + if ((Hsti->Role == Role) && ((ImplementationID == NULL) || (StrCmp (ImplementationID, Hsti->ImplementationID) == 0))) { break; } else { @@ -206,12 +200,12 @@ InternalHstiIsValidTable ( } } if (Index == sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) { - DEBUG ((EFI_D_ERROR, "ImplementationID is no NUL CHAR\n")); + DEBUG ((EFI_D_ERROR, "ImplementationID has no NUL CHAR\n")); return FALSE; } ErrorStringSize = HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3; - ErrorString = (CHAR16 *)((UINTN)Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3); + ErrorString = (CHAR16 *)((UINTN)Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 3); // // basic check for ErrorString @@ -311,7 +305,7 @@ HstiLibSetTable ( CopyMem (&HstiAip->Aip, &mAdapterInformationProtocol, sizeof(EFI_ADAPTER_INFORMATION_PROTOCOL)); HstiAip->HstiSize = HstiSize; HstiAip->HstiMaxSize = HstiSize; - + Handle = NULL; Status = gBS->InstallMultipleProtocolInterfaces ( &Handle, @@ -416,6 +410,7 @@ InternalHstiRecordFeaturesVerified ( Hsti, HstiSize ); + FreePool (Hsti); return Status; } @@ -545,6 +540,8 @@ InternalHstiRecordErrorString ( NewHsti, NewHstiSize ); + FreePool (Hsti); + FreePool (NewHsti); return Status; }