linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input - keyboard: fix theoretical race on vt switch
@ 2009-09-03 16:04 Alan Jenkins
  2009-09-05  7:09 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Jenkins @ 2009-09-03 16:04 UTC (permalink / raw)
  To: linux-input

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 <alan-jenkins@tuffmail.co.uk>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-05 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-03 16:04 [PATCH] Input - keyboard: fix theoretical race on vt switch Alan Jenkins
2009-09-05  7:09 ` Dmitry Torokhov
2009-09-05 14:16   ` [PATCHv2] " Alan Jenkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).