Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stanislav Kozina and committed by
Greg Kroah-Hartman
e9490e93 6683549e

+2 -1
+2 -1
drivers/tty/n_tty.c
··· 1742 1742 1743 1743 do_it_again: 1744 1744 1745 - BUG_ON(!tty->read_buf); 1745 + if (WARN_ON(!tty->read_buf)) 1746 + return -EAGAIN; 1746 1747 1747 1748 c = job_control(tty, file); 1748 1749 if (c < 0)