diff options
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r-- | drivers/char/pty.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 4e6490bda751..c98450023030 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) | |||
501 | return index; | 501 | return index; |
502 | 502 | ||
503 | mutex_lock(&tty_mutex); | 503 | mutex_lock(&tty_mutex); |
504 | retval = tty_init_dev(ptm_driver, index, &tty, 1); | 504 | tty = tty_init_dev(ptm_driver, index, 1); |
505 | mutex_unlock(&tty_mutex); | 505 | mutex_unlock(&tty_mutex); |
506 | 506 | ||
507 | if (retval) | 507 | if (IS_ERR(tty)) { |
508 | retval = PTR_ERR(tty); | ||
508 | goto out; | 509 | goto out; |
510 | } | ||
509 | 511 | ||
510 | set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ | 512 | set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ |
511 | filp->private_data = tty; | 513 | filp->private_data = tty; |