mirror of https://github.com/acidanthera/audk.git
InitializeUnicodeCollationSupportWorker mixed the use of Status variable for OpenProtocol and return, it will cause the function to return EFI_SUCCESS even the proper UnicodeCollation is absent. Add ReturnStatus to hold the return status.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> (based on FatPkg commit c7046d14e7ebbb03282a5225ed43feee7889a9e9) [jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Mark Doran <mark.doran@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
3ba5368df0
commit
4a30cd67a5
|
@ -2,7 +2,7 @@
|
||||||
Unicode Collation Support component that hides the trivial difference of Unicode Collation
|
Unicode Collation Support component that hides the trivial difference of Unicode Collation
|
||||||
and Unicode collation 2 Protocol.
|
and Unicode collation 2 Protocol.
|
||||||
|
|
||||||
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available
|
This program and the accompanying materials are licensed and made available
|
||||||
under the terms and conditions of the BSD License which accompanies this
|
under the terms and conditions of the BSD License which accompanies this
|
||||||
distribution. The full text of the license may be found at
|
distribution. The full text of the license may be found at
|
||||||
|
@ -40,6 +40,7 @@ InitializeUnicodeCollationSupportWorker (
|
||||||
IN CONST CHAR8 *DefaultLanguage
|
IN CONST CHAR8 *DefaultLanguage
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
EFI_STATUS ReturnStatus;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINTN NumHandles;
|
UINTN NumHandles;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
@ -63,7 +64,7 @@ InitializeUnicodeCollationSupportWorker (
|
||||||
Iso639Language = (BOOLEAN) (ProtocolGuid == &gEfiUnicodeCollationProtocolGuid);
|
Iso639Language = (BOOLEAN) (ProtocolGuid == &gEfiUnicodeCollationProtocolGuid);
|
||||||
GetEfiGlobalVariable2 (VariableName, (VOID**) &Language, NULL);
|
GetEfiGlobalVariable2 (VariableName, (VOID**) &Language, NULL);
|
||||||
|
|
||||||
Status = EFI_UNSUPPORTED;
|
ReturnStatus = EFI_UNSUPPORTED;
|
||||||
for (Index = 0; Index < NumHandles; Index++) {
|
for (Index = 0; Index < NumHandles; Index++) {
|
||||||
//
|
//
|
||||||
// Open Unicode Collation Protocol
|
// Open Unicode Collation Protocol
|
||||||
|
@ -94,7 +95,7 @@ InitializeUnicodeCollationSupportWorker (
|
||||||
if (BestLanguage != NULL) {
|
if (BestLanguage != NULL) {
|
||||||
FreePool (BestLanguage);
|
FreePool (BestLanguage);
|
||||||
mUnicodeCollationInterface = Uci;
|
mUnicodeCollationInterface = Uci;
|
||||||
Status = EFI_SUCCESS;
|
ReturnStatus = EFI_SUCCESS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +106,7 @@ InitializeUnicodeCollationSupportWorker (
|
||||||
|
|
||||||
FreePool (Handles);
|
FreePool (Handles);
|
||||||
|
|
||||||
return Status;
|
return ReturnStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue