diff options
author | Andy Whitcroft <apw@canonical.com> | 2010-12-15 10:54:25 +0000 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-03-16 15:56:58 -0600 |
commit | 7f64f33d1adfee4baaa023d6c4d9ba426c27fa5b (patch) | |
tree | b6e2feea122c63ef1866ae19637003968459f421 /drivers | |
parent | c94d696dbd411648838f1e0e47802c0c9b4d8a76 (diff) |
UBUNTU: SAUCE: vt -- fix handoff numbering to 1..n and add range checks
BugLink: http://bugs.launchpad.net/bugs/689606
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/vt/vt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 5ca9be1726e4..097b63d56433 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -170,7 +170,7 @@ module_param(global_cursor_default, int, S_IRUGO | S_IWUSR); static int cur_default = CUR_DEFAULT; module_param(cur_default, int, S_IRUGO | S_IWUSR); -int vt_handoff = -1; +int vt_handoff = 0; module_param_named(handoff, vt_handoff, int, S_IRUGO | S_IWUSR); /* @@ -2941,8 +2941,8 @@ static int __init con_init(void) mod_timer(&console_timer, jiffies + (blankinterval * HZ)); } - if (vt_handoff >= 0) { - currcons = vt_handoff; + if (vt_handoff > 0 && vt_handoff <= MAX_NR_CONSOLES) { + currcons = vt_handoff - 1; vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT); INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); visual_init(vc, currcons, 1); @@ -2950,7 +2950,7 @@ static int __init con_init(void) vc_init(vc, vc->vc_rows, vc->vc_cols, 0, KD_TRANSPARENT); } for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) { - if (currcons == vt_handoff) + if (currcons == vt_handoff - 1) continue; vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), GFP_NOWAIT); INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); @@ -2961,10 +2961,10 @@ static int __init con_init(void) currcons || !vc->vc_sw->con_save_screen, KD_TEXT); } currcons = fg_console = 0; - if (vt_handoff >= 0) { - printk(KERN_INFO "vt handoff: transparent VT on %d\n", + if (vt_handoff > 0) { + printk(KERN_INFO "vt handoff: transparent VT on vt#%d\n", vt_handoff); - currcons = fg_console = vt_handoff; + currcons = fg_console = vt_handoff - 1; } master_display_fg = vc = vc_cons[currcons].d; set_origin(vc); |