Strip assumes that the tty drivers always have a set_termios method which
may not be true. Check this when binding to the tty so that we don't oops
later.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Alan Cox 2008-05-12 12:29:25 +01:00 коммит произвёл Linus Torvalds
Родитель 492c2e476e
Коммит 79f999d0aa
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -2611,7 +2611,7 @@ static int strip_open(struct tty_struct *tty)
* We need a write method.
*/
if (tty->ops->write == NULL)
if (tty->ops->write == NULL || tty->ops->set_termios == NULL)
return -EOPNOTSUPP;
/*