diff options
author | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-12-30 22:29:54 +0000 |
---|---|---|
committer | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-12-30 22:29:54 +0000 |
commit | abef1c7a096faf26c0bb32897de6cf07ec256863 (patch) | |
tree | da9f7207b1918da6105fedfe883e83ca8682d086 | |
parent | c3522526f18e732b15ddfed48ca24eabdb5c1a23 (diff) | |
download | edk2-platforms-abef1c7a096faf26c0bb32897de6cf07ec256863.tar.xz |
Prevent a NULL device path from being passed into REPORT_STATUS_CODE_WITH_DEVICE_PATH by building child device path before using any of the Serial I/O Protocol services.
This guarantees that child device path is valid even if an error is returned from one of Serial I/O Protocol services in Start().
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11210 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index 7732db8b38..04c79aff5a 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -737,29 +737,6 @@ TerminalDriverBindingStart ( goto ReportError;
}
- Status = TerminalConOutReset (SimpleTextOutput, FALSE);
- if (EFI_ERROR (Status)) {
- goto ReportError;
- }
-
- Status = TerminalConOutSetMode (SimpleTextOutput, 0);
- if (EFI_ERROR (Status)) {
- goto ReportError;
- }
-
- Status = TerminalConOutEnableCursor (SimpleTextOutput, TRUE);
- if (EFI_ERROR (Status)) {
- goto ReportError;
- }
-
- Status = gBS->CreateEvent (
- EVT_TIMER,
- TPL_CALLBACK,
- NULL,
- NULL,
- &TerminalDevice->TwoSecondTimeOut
- );
-
//
// Build the component name for the child device
//
@@ -850,6 +827,29 @@ TerminalDriverBindingStart ( goto Error;
}
+ Status = TerminalConOutReset (SimpleTextOutput, FALSE);
+ if (EFI_ERROR (Status)) {
+ goto ReportError;
+ }
+
+ Status = TerminalConOutSetMode (SimpleTextOutput, 0);
+ if (EFI_ERROR (Status)) {
+ goto ReportError;
+ }
+
+ Status = TerminalConOutEnableCursor (SimpleTextOutput, TRUE);
+ if (EFI_ERROR (Status)) {
+ goto ReportError;
+ }
+
+ Status = gBS->CreateEvent (
+ EVT_TIMER,
+ TPL_CALLBACK,
+ NULL,
+ NULL,
+ &TerminalDevice->TwoSecondTimeOut
+ );
+
Status = gBS->InstallProtocolInterface (
&TerminalDevice->Handle,
&gEfiDevicePathProtocolGuid,
|