[PATCH] missing NULL check in drivers/char/n_tty.c

From: Dan Aloni
Date: Mon Jun 21 2004 - 01:42:54 EST


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@xxxxxxxxxxx>

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@xxxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/