Signed-off-by: Ryan S. Arnold --- linux-2.6.9-rc1/drivers/char/hvc_console.c Fri Sep 10 15:14:57 2004 +++ hvc_console_working_linux-2.6.9-rc1/drivers/char/hvc_console.c Mon Sep 13 10:29:53 2004 @@ -265,6 +265,11 @@ */ tty_wait_until_sent(tty, HVC_CLOSE_WAIT); + /* + * Since the line disc doesn't block writes during tty close + * operations we'll set driver_data to NULL and then make sure + * to check tty->driver_data for NULL in hvc_write(). + */ tty->driver_data = NULL; if (irq != NO_IRQ) @@ -418,6 +423,10 @@ struct hvc_struct *hp = tty->driver_data; int written; + /* This write was probably executed during a tty close. */ + if (!hp) + return -EPIPE; + if (from_user) written = __hvc_write_user(hp, buf, count); else