diff --git a/drivers/tty/arch/earm/rs232.c b/drivers/tty/arch/earm/rs232.c index 13d817591..f9a9e8777 100644 --- a/drivers/tty/arch/earm/rs232.c +++ b/drivers/tty/arch/earm/rs232.c @@ -266,8 +266,9 @@ rs_write(register tty_t *tp, int try) tp->tty_outcum += count; if ((tp->tty_outleft -= count) == 0) { /* Output is finished, reply to the writer. */ - chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, - tp->tty_outcum); + if (tp->tty_outcaller != KERNEL) + chardriver_reply_task(tp->tty_outcaller, + tp->tty_outid, tp->tty_outcum); tp->tty_outcum = 0; tp->tty_outcaller = NONE; } @@ -275,7 +276,9 @@ rs_write(register tty_t *tp, int try) } if (tp->tty_outleft > 0 && tp->tty_termios.c_ospeed == B0) { /* Oops, the line has hung up. */ - chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO); + if (tp->tty_outcaller != KERNEL) + chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, + EIO); tp->tty_outleft = tp->tty_outcum = 0; tp->tty_outcaller = NONE; } diff --git a/drivers/tty/arch/i386/console.c b/drivers/tty/arch/i386/console.c index efb49e852..27d95db5b 100644 --- a/drivers/tty/arch/i386/console.c +++ b/drivers/tty/arch/i386/console.c @@ -223,10 +223,11 @@ int try; flush(cons); /* transfer anything buffered to the screen */ - /* Reply to the writer if all output is finished or if an error occured. */ + /* Reply to the writer if all output is finished or if an error occurred. */ if (tp->tty_outleft == 0 || result != OK) { - chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, - result != OK ? result : tp->tty_outcum); + if (tp->tty_outcaller != KERNEL) + chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, + result != OK ? result : tp->tty_outcum); tp->tty_outcum = tp->tty_outleft = 0; tp->tty_outcaller = NONE; } diff --git a/drivers/tty/arch/i386/rs232.c b/drivers/tty/arch/i386/rs232.c index d98979d3d..0e29628e3 100644 --- a/drivers/tty/arch/i386/rs232.c +++ b/drivers/tty/arch/i386/rs232.c @@ -274,15 +274,17 @@ static int rs_write(register tty_t *tp, int try) tp->tty_outcum += count; if ((tp->tty_outleft -= count) == 0) { /* Output is finished, reply to the writer. */ - chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, - tp->tty_outcum); + if (tp->tty_outcaller != KERNEL) + chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, + tp->tty_outcum); tp->tty_outcum = 0; tp->tty_outcaller = NONE; } } if (tp->tty_outleft > 0 && tp->tty_termios.c_ospeed == B0) { /* Oops, the line has hung up. */ - chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO); + if (tp->tty_outcaller != KERNEL) + chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO); tp->tty_outleft = tp->tty_outcum = 0; tp->tty_outcaller = NONE; }