diff options
author | Harry Liebel <Harry.Liebel@arm.com> | 2014-04-11 15:57:06 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-04-11 15:57:06 +0000 |
commit | 13354807d4881376475c3dfa567df6b515aea9e0 (patch) | |
tree | 5d4b6fec098f85155ec04d8aa1204a24391d095a /ArmPlatformPkg | |
parent | 4c8bb1eb3bd7b40010924f23824a9e8d91af015c (diff) | |
download | edk2-platforms-13354807d4881376475c3dfa567df6b515aea9e0.tar.xz |
ArmPlatformPkg/Bds: Fix loading Timeout from NV storage
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15459 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r-- | ArmPlatformPkg/Bds/Bds.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ArmPlatformPkg/Bds/Bds.c b/ArmPlatformPkg/Bds/Bds.c index fa9dfbafc4..d2b62252ed 100644 --- a/ArmPlatformPkg/Bds/Bds.c +++ b/ArmPlatformPkg/Bds/Bds.c @@ -367,8 +367,11 @@ StartDefaultBootOnTimeout ( Size = sizeof(UINT16);
Timeout = (UINT16)PcdGet16 (PcdPlatformBootTimeOut);
- TimeoutPtr = &Timeout;
- GetGlobalEnvironmentVariable (L"Timeout", &Timeout, &Size, (VOID**)&TimeoutPtr);
+ Status = GetGlobalEnvironmentVariable (L"Timeout", &Timeout, &Size, (VOID**)&TimeoutPtr);
+ if (!EFI_ERROR (Status)) {
+ Timeout = *TimeoutPtr;
+ FreePool (TimeoutPtr);
+ }
if (Timeout != 0xFFFF) {
if (Timeout > 0) {
|