From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux-input@vger.kernel.org
Subject: [PATCH] Input - keyboard: fix theoretical race on vt switch
Date: Thu, 03 Sep 2009 17:04:57 +0100 [thread overview]
Message-ID: <4A9FE929.8030804@tuffmail.co.uk> (raw)
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
next reply other threads:[~2009-09-03 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-03 16:04 Alan Jenkins [this message]
2009-09-05 7:09 ` [PATCH] Input - keyboard: fix theoretical race on vt switch Dmitry Torokhov
2009-09-05 14:16 ` [PATCHv2] " Alan Jenkins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A9FE929.8030804@tuffmail.co.uk \
--to=alan-jenkins@tuffmail.co.uk \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.