public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] missing NULL check in drivers/char/n_tty.c
@ 2004-06-21  6:38 Dan Aloni
  2004-06-21  6:58 ` Andrew Morton
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Aloni @ 2004-06-21  6:38 UTC (permalink / raw)
  To: Linux Kernel List; +Cc: Andrew Morton

Hello,

The rest of the kernel treats tty->driver->chars_in_buffer as a possible
NULL. This patch changes normal_poll() to be consistent with the rest of
the code.

Signed-off-by: Dan Aloni <da-x@colinux.org>

BTW, who is currently maintaining the tty subsystem?

--- linux-2.6.7/drivers/char/n_tty.c	2004-06-21 09:30:11.000000000 +0300
+++ linux-2.6.7/drivers/char/n_tty.c	2004-06-21 09:28:04.000000000 +0300
@@ -1272,8 +1272,8 @@
 		else
 			tty->minimum_to_wake = 1;
 	}
-	if (tty->driver->chars_in_buffer(tty) < WAKEUP_CHARS &&
-			tty->driver->write_room(tty) > 0)
+	if ((!tty->driver->chars_in_buffer || tty->driver->chars_in_buffer(tty) < WAKEUP_CHARS)
+	   && tty->driver->write_room(tty) > 0)
 		mask |= POLLOUT | POLLWRNORM;
 	return mask;
 }

-- 
Dan Aloni
da-x@colinux.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-06-21 23:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-21  6:38 [PATCH] missing NULL check in drivers/char/n_tty.c Dan Aloni
2004-06-21  6:58 ` Andrew Morton
2004-06-21  7:36   ` Dan Aloni
2004-06-21  7:39     ` Andrew Morton
2004-06-21  8:24       ` Dan Aloni
2004-06-21 15:06         ` Paul Fulghum
2004-06-21 18:46           ` Andrew Morton
2004-06-21 19:52             ` Paul Fulghum
2004-06-21 22:48             ` Dan Aloni
2004-06-21 23:56               ` Paul Fulghum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox