Thread (3 messages) 3 messages, 2 authors, 2009-09-05

[PATCH] Input - keyboard: fix theoretical race on vt switch

From: Alan Jenkins <hidden>
Date: 2009-09-03 16:04:59
Subsystem: char and misc drivers, the rest · Maintainers: Arnd Bergmann, Greg Kroah-Hartman, Linus Torvalds

Switching virtual consoles could change fg_console between

	vc = vc_cons[fg_console].d
and
	kbd = kbd_table + fg_console

Replace the second instance of fg_console with vc->vc_num.

Signed-off-by: Alan Jenkins <redacted>
---
 drivers/char/keyboard.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 737be95..4b564c5 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -1157,7 +1157,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
 		tty->driver_data = vc;
 	}
 
-	kbd = kbd_table + fg_console;
+	kbd = kbd_table + vc->vc_num;
 
 	if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
 		sysrq_alt = down ? keycode : 0;
-- 
1.6.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help