aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStanislav Kozina <skozina@redhat.com>2012-08-16 12:01:47 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-07 08:32:24 -0700
commite2a43abf3d9c6a3828d9a02c3de0d8bf16bd4b90 (patch)
tree96ed423a829f0d1a0d0e072dd72eedac9334571e /drivers
parentf810716cd61810278caee8eefed22e8706e49125 (diff)
Remove BUG_ON from n_tty_read()
commit e9490e93c1978b6669f3e993caa3189be13ce459 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-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 94b6eda87af..2303a02e9dc 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1727,7 +1727,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)