diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-09-12 11:43:47 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-09-12 11:43:47 +0100 |
commit | 8d701af28f2e5777a5cee19346a60859841459c6 (patch) | |
tree | dd908160c9014aa85da77c3fc56326db2c2dd8a5 /xen/drivers/char/console.c | |
parent | fbf6c4db1e48d60e50c856418eda7947b185bc2f (diff) | |
download | xen-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.c | 14 |
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); |