[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1233528227-12339-1-git-send-email-jirislaby@gmail.com>
Date: Sun, 1 Feb 2009 23:43:47 +0100
From: Jiri Slaby <jirislaby@...il.com>
To: alan@...rguk.ukuu.org.uk
Cc: linux-kernel@...r.kernel.org, Jiri Slaby <jirislaby@...il.com>
Subject: [PATCH 1/1] TTY: pty, lookup retval fixup
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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists