&VarSize,\r
&mSystemConfiguration\r
);\r
- ASSERT_EFI_ERROR(Status);\r
+ if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {\r
+ //The setup variable is corrupted\r
+ VarSize = sizeof(SYSTEM_CONFIGURATION);\r
+ Status = gRT->GetVariable(\r
+ L"SetupRecovery",\r
+ &gEfiNormalSetupGuid,\r
+ NULL,\r
+ &VarSize,\r
+ &mSystemConfiguration\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+ } \r
\r
//\r
// Install on a new handle\r