]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Remove BUG_ON from n_tty_read()
authorStanislav Kozina <skozina@redhat.com>
Thu, 16 Aug 2012 11:01:47 +0000 (12:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Oct 2012 15:27:24 +0000 (08:27 -0700)
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>
drivers/tty/n_tty.c

index c3954fbf6ac402d7d8e8a92389c4f1ecdc065e53..d7164bfe82250004a74f43dd0a2df1e8246b326e 100644 (file)
@@ -1728,7 +1728,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)