summaryrefslogtreecommitdiff
path: root/drivers/char/pty.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2010-08-24 07:48:34 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 10:19:58 -0700
commitf573bd1764f0f3f47754ca1ae7b2eb2909798a60 (patch)
treebfc4c03b38bc74bb29dbacce212fe2efc802eb46 /drivers/char/pty.c
parent8a28af7f7e42cd0f107e0d84e4ece89e7ef24d3f (diff)
tty: Remove __GFP_NOFAIL from tty_add_file()
This patch removes __GFP_NOFAIL use from tty_add_file() and adds proper error handling to the call-sites of the function. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Pekka Enberg <penberg@kernel.org> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r--drivers/char/pty.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index c350d01716bd..923a48585501 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -676,7 +676,9 @@ static int ptmx_open(struct inode *inode, struct file *filp)
set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
- tty_add_file(tty, filp);
+ retval = tty_add_file(tty, filp);
+ if (retval)
+ goto out;
retval = devpts_pty_new(inode, tty->link);
if (retval)