Revision: 18962
http://sourceforge.net/p/edk2/code/18962
Author: lzeng14
Date: 2015-11-26 08:46:20 +0000 (Thu, 26 Nov 2015)
Log Message:
-----------
MdeModulePkg: TerminalDxe: avoid checking uninitialized variable
The SerialIo->GetControl() function is not required to set the
Control output parameter on error. Make sure we apply the
EFI_SERIAL_INPUT_BUFFER_EMPTY optimization in
TerminalConInTimerHandler() only if the SerialIo->GetControl()
function call set that bit in the Control variable.
Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Feng Tian <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Suggested-by: Laszlo Ersek <[email protected]>
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Michael Kinney <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
Modified: trunk/edk2/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
2015-11-26 08:17:46 UTC (rev 18961)
+++ trunk/edk2/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
2015-11-26 08:46:20 UTC (rev 18962)
@@ -2,7 +2,7 @@
Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
which accompanies this distribution. The full text of the license may be
found at
@@ -562,10 +562,11 @@
}
//
// Check whether serial buffer is empty.
+ // Skip the key transfer loop only if the SerialIo protocol instance
+ // successfully reports EFI_SERIAL_INPUT_BUFFER_EMPTY.
//
Status = SerialIo->GetControl (SerialIo, &Control);
-
- if ((Control & EFI_SERIAL_INPUT_BUFFER_EMPTY) == 0) {
+ if (EFI_ERROR (Status) || ((Control & EFI_SERIAL_INPUT_BUFFER_EMPTY) == 0)) {
//
// Fetch all the keys in the serial buffer,
// and insert the byte stream into RawFIFO.
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits