Messages in this thread Patch in this message | | | From | Jiri Slaby <> | Subject | [PATCH 1/1] TTY: pty, lookup retval fixup | Date | Sun, 1 Feb 2009 23:43:47 +0100 |
| |
Make sure we fail on NULL return value possibly returned by master tty lookup.
Convert NULL to ERR_PTR(-ENODEV) in ptm_unix98_lookup, since NULL is not captured by IS_ERR() in __tty_open.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com> --- drivers/char/pty.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 31038a0..261223b 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -508,7 +508,7 @@ static struct tty_struct *ptm_unix98_lookup(struct tty_driver *driver, struct tty_struct *tty = devpts_get_tty(ptm_inode, idx); if (tty) tty = tty->link; - return tty; + return tty ? : ERR_PTR(-ENODEV); } /** -- 1.6.1.2
| |