# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Node ID ba5495a418d7a48d61a84cd18348fb2c853477ff # Parent 8e55c5c1147589b7a6a1875384d4317aec7ccf84 xenconsole fix. reference of tty->count in xencons_close() is racy. It must be protected by tty_sem semaphore like con_close() in drivers/char/vt.c PATCHNAME: add_tty_sem Signed-off-by: Isaku Yamahata diff -r 8e55c5c11475 -r ba5495a418d7 linux-2.6-xen-sparse/drivers/xen/console/console.c --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c Wed Jul 05 18:48:41 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c Fri Jul 07 17:34:08 2006 +0900 @@ -536,6 +536,7 @@ static void xencons_close(struct tty_str if (DUMMY_TTY(tty)) return; + down(&tty_sem); if (tty->count == 1) { tty->closing = 1; tty_wait_until_sent(tty, 0); @@ -548,6 +549,7 @@ static void xencons_close(struct tty_str xencons_tty = NULL; spin_unlock_irqrestore(&xencons_lock, flags); } + up(&tty_sem); } static struct tty_operations xencons_ops = {