aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/serial_console.c
diff options
context:
space:
mode:
authorShao Miller <sha0.miller@gmail.com>2012-10-05 15:14:12 +0100
committerMichael Brown <mcb30@ipxe.org>2012-10-05 15:18:57 +0100
commita712dae709adc76c76646fa1c86d2cfb5c3edfbc (patch)
tree246fe611b372b7ec0b86acba5b0354e88b6a6ab3 /src/core/serial_console.c
parentfcdfe817644c601f40a5435c03f16a46b5264ab1 (diff)
downloadipxe-a712dae709adc76c76646fa1c86d2cfb5c3edfbc.tar.gz
[serial] Don't enable serial console without serial support
serial_console_init() would enable serial console support without knowing if the serial driver succeeded or not. As a result, the serial console would interfere with a normal keyboard on a system lacking serial support. Reported-by: Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> Signed-off-by: Shao Miller <sha0.miller@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/serial_console.c')
-rw-r--r--src/core/serial_console.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/serial_console.c b/src/core/serial_console.c
index bbddd6b2..3852a308 100644
--- a/src/core/serial_console.c
+++ b/src/core/serial_console.c
@@ -18,9 +18,12 @@
struct console_driver serial_console __console_driver;
static void serial_console_init ( void ) {
- /* Serial driver initialization should already be done,
- * time to enable the serial console. */
- serial_console.disabled = 0;
+ /*
+ * Check if serial driver initialization is done.
+ * If so, it's time to enable the serial console.
+ */
+ if ( serial_initialized )
+ serial_console.disabled = 0;
}
struct console_driver serial_console __console_driver = {