From 4a30cd67a507d0a57a724bbe4d783b58975d0d10 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Wed, 29 May 2013 09:01:46 +0000 Subject: 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 Reviewed-by: Ruiyu Ni (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 Acked-by: Mark Doran Acked-by: Laszlo Ersek --- FatPkg/EnhancedFatDxe/UnicodeCollation.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'FatPkg') diff --git a/FatPkg/EnhancedFatDxe/UnicodeCollation.c b/FatPkg/EnhancedFatDxe/UnicodeCollation.c index 50720f3df9..61b9aab4d9 100644 --- a/FatPkg/EnhancedFatDxe/UnicodeCollation.c +++ b/FatPkg/EnhancedFatDxe/UnicodeCollation.c @@ -2,7 +2,7 @@ Unicode Collation Support component that hides the trivial difference of Unicode Collation and Unicode collation 2 Protocol. - Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2013, 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 @@ -40,6 +40,7 @@ InitializeUnicodeCollationSupportWorker ( IN CONST CHAR8 *DefaultLanguage ) { + EFI_STATUS ReturnStatus; EFI_STATUS Status; UINTN NumHandles; UINTN Index; @@ -63,7 +64,7 @@ InitializeUnicodeCollationSupportWorker ( Iso639Language = (BOOLEAN) (ProtocolGuid == &gEfiUnicodeCollationProtocolGuid); GetEfiGlobalVariable2 (VariableName, (VOID**) &Language, NULL); - Status = EFI_UNSUPPORTED; + ReturnStatus = EFI_UNSUPPORTED; for (Index = 0; Index < NumHandles; Index++) { // // Open Unicode Collation Protocol @@ -94,7 +95,7 @@ InitializeUnicodeCollationSupportWorker ( if (BestLanguage != NULL) { FreePool (BestLanguage); mUnicodeCollationInterface = Uci; - Status = EFI_SUCCESS; + ReturnStatus = EFI_SUCCESS; break; } } @@ -105,7 +106,7 @@ InitializeUnicodeCollationSupportWorker ( FreePool (Handles); - return Status; + return ReturnStatus; } /** -- cgit v1.2.3