aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers/char/console.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-09-12 11:43:47 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-09-12 11:43:47 +0100
commit8d701af28f2e5777a5cee19346a60859841459c6 (patch)
treedd908160c9014aa85da77c3fc56326db2c2dd8a5 /xen/drivers/char/console.c
parentfbf6c4db1e48d60e50c856418eda7947b185bc2f (diff)
downloadxen-8d701af28f2e5777a5cee19346a60859841459c6.tar.gz
xen-8d701af28f2e5777a5cee19346a60859841459c6.tar.bz2
xen-8d701af28f2e5777a5cee19346a60859841459c6.zip
Check the existence of serial port before using
Signed-off-by: Huacai Chen <huacai.chen@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/drivers/char/console.c')
-rw-r--r--xen/drivers/char/console.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index c326a6fd20..203f8459fc 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -543,10 +543,18 @@ void __init init_console(void)
{
if ( *p == ',' )
p++;
- if ( strncmp(p, "com", 3) == 0 )
- sercon_handle = serial_parse_handle(p);
- else if ( strncmp(p, "vga", 3) == 0 )
+ if ( !strncmp(p, "vga", 3) )
vga_init();
+ else if ( strncmp(p, "com", 3) ||
+ (sercon_handle = serial_parse_handle(p)) == -1 )
+ {
+ char *q = strchr(p, ',');
+ if ( q != NULL )
+ *q = '\0';
+ printk("Bad console= option '%s'\n", p);
+ if ( q != NULL )
+ *q = ',';
+ }
}
serial_set_rx_handler(sercon_handle, serial_rx);