From: Sukadev Bhattiprolu Date: Wed, 30 Apr 2008 07:54:20 +0000 (-0700) Subject: devpts: propagate error code from devpts_pty_new X-Git-Tag: v2.6.26-rc1~172 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f8f9d66cdac4845409f7520e4f287a1907a6bf9;p=linux-2.6 devpts: propagate error code from devpts_pty_new Have ptmx_open() propagate any error code returned by devpts_pty_new() (which returns either 0 or -ENOMEM anyway). Signed-off-by: Sukadev Bhattiprolu Acked-by: Serge Hallyn Acked-by: H. Peter Anvin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index ddfa529936..edcb7e471f 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -2838,8 +2838,8 @@ static int ptmx_open(struct inode *inode, struct file *filp) filp->private_data = tty; file_move(filp, &tty->tty_files); - retval = -ENOMEM; - if (devpts_pty_new(tty->link)) + retval = devpts_pty_new(tty->link); + if (retval) goto out1; check_tty_count(tty, "ptmx_open");