\r
Status = GetEnvironmentVariable (ConsoleVarName, NULL, NULL, (VOID**)&DevicePathInstances);\r
if (EFI_ERROR(Status)) {\r
+ // In case no default console device path has been defined we assume a driver handles the console (eg: SimpleTextInOutSerial)\r
+ if ((DefaultConsolePaths == NULL) || (DefaultConsolePaths[0] == L'\0')) {\r
+ *DevicePaths = NULL;\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);\r
ASSERT_EFI_ERROR(Status);\r
\r
if (!EFI_ERROR(Status)) {\r
*DevicePaths = DevicePathInstances;\r
}\r
- return EFI_SUCCESS;\r
+ return Status;\r
}\r
\r
STATIC\r
EFI_DEVICE_PATH_PROTOCOL* DevicePath;\r
\r
// Connect all the Device Path Consoles\r
- do {\r
+ while (ConsoleDevicePaths != NULL) {\r
DevicePath = GetNextDevicePathInstance (&ConsoleDevicePaths, &Size);\r
\r
Status = BdsConnectDevicePath (DevicePath, Handle, NULL);\r
if (!EFI_ERROR(Status) && (*Interface == NULL)) {\r
Status = gBS->HandleProtocol (*Handle, Protocol, Interface);\r
}\r
- } while (ConsoleDevicePaths != NULL);\r
+ }\r
\r
// No Device Path has been defined for this console interface. We take the first protocol implementation\r
if (*Interface == NULL) {\r
// By getting the Console Device Paths from the environment variables before initializing the console pipe, we\r
// create the 3 environment variables (ConIn, ConOut, ConErr) that allows to initialize all the console interface\r
// of newly installed console drivers\r
- Status = GetConsoleDevicePathFromVariable (L"ConOut", (CHAR16*)PcdGetPtr(PcdDefaultConOutPaths),&ConOutDevicePaths);\r
+ Status = GetConsoleDevicePathFromVariable (L"ConOut", (CHAR16*)PcdGetPtr(PcdDefaultConOutPaths), &ConOutDevicePaths);\r
ASSERT_EFI_ERROR (Status);\r
- Status = GetConsoleDevicePathFromVariable (L"ConIn", (CHAR16*)PcdGetPtr(PcdDefaultConInPaths),&ConInDevicePaths);\r
+ Status = GetConsoleDevicePathFromVariable (L"ConIn", (CHAR16*)PcdGetPtr(PcdDefaultConInPaths), &ConInDevicePaths);\r
ASSERT_EFI_ERROR (Status);\r
- Status = GetConsoleDevicePathFromVariable (L"ConErr", (CHAR16*)PcdGetPtr(PcdDefaultConOutPaths),&ConErrDevicePaths);\r
+ Status = GetConsoleDevicePathFromVariable (L"ConErr", (CHAR16*)PcdGetPtr(PcdDefaultConOutPaths), &ConErrDevicePaths);\r
ASSERT_EFI_ERROR (Status);\r
\r
// Initialize the Consoles\r