summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorStanislav Kozina <skozina@redhat.com>2012-08-16 12:01:47 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-16 11:53:14 -0700
commite9490e93c1978b6669f3e993caa3189be13ce459 (patch)
tree3fd3cd99a484a27e7beaf348c96f87859b7bf1ac /drivers/tty
parent6683549e4ba050cddd8fa88c3f1e53b825fdcb6d (diff)
downloadlinux-e9490e93c1978b6669f3e993caa3189be13ce459.tar.bz2
Remove BUG_ON from n_tty_read()
Change the BUG_ON to WARN_ON and return in case of tty->read_buf==NULL. We want to track a couple of long standing reports of this but at the same time we can avoid killing the box. Signed-off-by: Stanislav Kozina <skozina@redhat.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Horses <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/n_tty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 6259242b7858..8c0b7b42319c 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1742,7 +1742,8 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
do_it_again:
- BUG_ON(!tty->read_buf);
+ if (WARN_ON(!tty->read_buf))
+ return -EAGAIN;
c = job_control(tty, file);
if (c < 0)