Skip to content

Commit

Permalink
devpts: propagate error code from devpts_pty_new
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sukadev Bhattiprolu authored and torvalds committed Apr 30, 2008
1 parent 86a9653 commit 4f8f9d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 4f8f9d6

Please sign in to comment.