]> err.no Git - linux-2.6/commitdiff
devpts: propagate error code from devpts_pty_new
authorSukadev Bhattiprolu <sukadev@us.ibm.com>
Wed, 30 Apr 2008 07:54:20 +0000 (00:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Apr 2008 15:29:48 +0000 (08:29 -0700)
Have ptmx_open() propagate any error code returned by devpts_pty_new()
(which returns either 0 or -ENOMEM anyway).

Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/tty_io.c

index ddfa529936e8a80a42b0b6259ba6d3a330eb5531..edcb7e471f029ff7ce829a815ad33e53ece74139 100644 (file)
@@ -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");