summaryrefslogtreecommitdiffstats
path: root/drivers/char/pty.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-10-13 10:42:29 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 09:51:43 -0700
commit73ec06fc5f5c8e1097a7a4a4ab2d7c6c3a007e81 (patch)
tree2c244c8b0d853f82e479eaf72ca64d6c9209c6a6 /drivers/char/pty.c
parent8b0a88d5912ab549d5adac2c8498ecdaae5319a5 (diff)
downloadop-kernel-dev-73ec06fc5f5c8e1097a7a4a4ab2d7c6c3a007e81.zip
op-kernel-dev-73ec06fc5f5c8e1097a7a4a4ab2d7c6c3a007e81.tar.gz
tty: Finish fixing up the init_dev interface to use ERR_PTR
Original suggestion and proposal from Sukadev Bhattiprolu. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r--drivers/char/pty.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 4e6490b..c984500 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -501,11 +501,13 @@ static int __ptmx_open(struct inode *inode, struct file *filp)
return index;
mutex_lock(&tty_mutex);
- retval = tty_init_dev(ptm_driver, index, &tty, 1);
+ tty = tty_init_dev(ptm_driver, index, 1);
mutex_unlock(&tty_mutex);
- if (retval)
+ if (IS_ERR(tty)) {
+ retval = PTR_ERR(tty);
goto out;
+ }
set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
filp->private_data = tty;
OpenPOWER on IntegriCloud