Thread (25 messages) 25 messages, 3 authors, 2012-08-16
STALE5043d

[PATCH] Remove BUG_ON from n_tty_read()

From: Stanislav Kozina <hidden>
Date: 2012-08-10 10:51:41
Subsystem: the rest, tty layer and serial drivers · Maintainers: Linus Torvalds, Greg Kroah-Hartman, Jiri Slaby

Change the BUG_ON to WARN_ON and return in case of tty->read_buf==NULL

Signed-off-by: Stanislav Kozina <redacted>
---
  drivers/tty/n_tty.c |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index df21f39..39c6202 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1728,7 +1728,10 @@ static ssize_t n_tty_read(struct tty_struct *tty, 
struct file *file,

  do_it_again:

-	BUG_ON(!tty->read_buf);
+	if (!tty->read_buf) {
+		WARN_ON(!tty->read_buf);
+		return -EAGAIN;
+	}

  	c = job_control(tty, file);
  	if (c < 0)
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help