patch-2.2.0-pre6 linux/drivers/char/keyboard.c

Next file: linux/drivers/char/n_tty.c
Previous file: linux/drivers/char/console.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.0-pre5/linux/drivers/char/keyboard.c linux/drivers/char/keyboard.c
@@ -202,8 +202,13 @@
 
 	tty = ttytab? ttytab[fg_console]: NULL;
 	if (tty && (!tty->driver_data)) {
-		/* This is to workaround ugly bug in tty_io.c, which
-                   does not do locking when it should */
+		/*
+		 * We touch the tty structure via the the ttytab array
+		 * without knowing whether or not tty is open, which
+		 * is inherently dangerous.  We currently rely on that
+		 * fact that console_open sets tty->driver_data when
+		 * it opens it, and clears it when it closes it.
+		 */
 		tty = NULL;
 	}
 	kbd = kbd_table + fg_console;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov