diff options
author | Jiri Slaby <jslaby@suse.cz> | 2011-10-12 05:32:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-11 12:35:13 -0500 |
commit | eece93cccb258072bf9a355faeca2ee2752b27e3 (patch) | |
tree | 7cb2d6f28c0ed95852a13962d6af81fd89f1fe47 | |
parent | 0c1f111ae7fcea822fd1c078ef48e88d93afc57a (diff) |
TTY: pty, release tty in all ptmx_open fail paths
commit 1177c0efc04d032644895b8d757f55b433912596 upstream.
Mistakenly, commit 64ba3dc3143d (tty: never hold BTM while getting
tty_mutex) switched one fail path in ptmx_open to not free the newly
allocated tty.
Fix that by jumping to the appropriate place. And rename the labels so
that it's clear what is going on there.
Introduced-in: v2.6.36-rc2
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/tty/pty.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 696e8510a5f..e18604b3fc7 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c | |||
@@ -699,15 +699,15 @@ static int ptmx_open(struct inode *inode, struct file *filp) | |||
699 | 699 | ||
700 | retval = devpts_pty_new(inode, tty->link); | 700 | retval = devpts_pty_new(inode, tty->link); |
701 | if (retval) | 701 | if (retval) |
702 | goto out1; | 702 | goto err_release; |
703 | 703 | ||
704 | retval = ptm_driver->ops->open(tty, filp); | 704 | retval = ptm_driver->ops->open(tty, filp); |
705 | if (retval) | 705 | if (retval) |
706 | goto out2; | 706 | goto err_release; |
707 | out1: | 707 | |
708 | tty_unlock(); | 708 | tty_unlock(); |
709 | return retval; | 709 | return 0; |
710 | out2: | 710 | err_release: |
711 | tty_unlock(); | 711 | tty_unlock(); |
712 | tty_release(inode, filp); | 712 | tty_release(inode, filp); |
713 | return retval; | 713 | return retval; |