Messages in this thread Patch in this message | | | From | Jiri Slaby <> | Subject | [PATCH 1/1] TTY: tty_io, lookup retval fixup | Date | Sun, 1 Feb 2009 22:39:16 +0100 |
| |
Make sure we fail on NULL return value possibly returned by pty master lookup.
Convert NULL to ERR_PTR(-ENODEV), since NULL is not captured by IS_ERR() in __tty_open.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com> --- drivers/char/tty_io.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index ff92099..2c14dd8 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1217,7 +1217,8 @@ static struct tty_struct *tty_driver_lookup_tty(struct tty_driver *driver, struct tty_struct *tty; if (driver->ops->lookup) - return driver->ops->lookup(driver, inode, idx); + return driver->ops->lookup(driver, inode, idx) ? : + ERR_PTR(-ENODEV); tty = driver->ttys[idx]; return tty; -- 1.6.1.2
| |