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
This commit is contained in:
mdkinney 2010-12-30 22:29:54 +00:00
parent c3522526f1
commit abef1c7a09
1 changed files with 23 additions and 23 deletions

View File

@ -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,