diff options
author | Jeff Fan <jeff.fan@intel.com> | 2014-07-28 05:55:10 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-07-28 05:55:10 +0000 |
commit | 37b971c590c4a3916c53bf23105e5f9d4ecdaaf3 (patch) | |
tree | 4e2a7032e21231dd7d89ad946dbd9f3f4d136f15 /IntelFrameworkModulePkg | |
parent | 9afa7499df3139379b5b6553fd89d797a7ba3ded (diff) | |
download | edk2-37b971c590c4a3916c53bf23105e5f9d4ecdaaf3.tar.gz edk2-37b971c590c4a3916c53bf23105e5f9d4ecdaaf3.tar.bz2 edk2-37b971c590c4a3916c53bf23105e5f9d4ecdaaf3.zip |
Sync patches r15544 and r15545 from main trunk.
1. Remove the assertion which may cause IsDevicePathValid() hang in DEBUG build.
2. Remove the RT attribute for HDDP variable and validate the variable content before using it.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2014@15688 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c index 134833286f..db7a75098d 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c @@ -2526,11 +2526,28 @@ BdsExpandPartitionPartialDevicePathToFull ( // If exist, search the front path which point to partition node in the variable instants.
// If fail to find or HD_BOOT_DEVICE_PATH_VARIABLE_NAME not exist, reconnect all and search in all system
//
- CachedDevicePath = BdsLibGetVariableAndSize (
- HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
- &gHdBootDevicePathVariablGuid,
- &CachedDevicePathSize
- );
+ GetVariable2 (
+ HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
+ &gHdBootDevicePathVariablGuid,
+ (VOID **) &CachedDevicePath,
+ &CachedDevicePathSize
+ );
+
+ //
+ // Delete the invalid HD_BOOT_DEVICE_PATH_VARIABLE_NAME variable.
+ //
+ if ((CachedDevicePath != NULL) && !IsDevicePathValid (CachedDevicePath, CachedDevicePathSize)) {
+ FreePool (CachedDevicePath);
+ CachedDevicePath = NULL;
+ Status = gRT->SetVariable (
+ HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
+ &gHdBootDevicePathVariablGuid,
+ 0,
+ 0,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
if (CachedDevicePath != NULL) {
TempNewDevicePath = CachedDevicePath;
@@ -2593,7 +2610,7 @@ BdsExpandPartitionPartialDevicePathToFull ( Status = gRT->SetVariable (
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
&gHdBootDevicePathVariablGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
GetDevicePathSize (CachedDevicePath),
CachedDevicePath
);
@@ -2692,7 +2709,7 @@ BdsExpandPartitionPartialDevicePathToFull ( Status = gRT->SetVariable (
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
&gHdBootDevicePathVariablGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
GetDevicePathSize (CachedDevicePath),
CachedDevicePath
);
|