aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2011-03-23 05:48:37 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-19 17:43:01 -0400
commit0259894c732837c801565d038eaecdcf8fc5bbe7 (patch)
treeaae559d20f622f024c87f5bab5524ee94e42c91b /drivers/tty
parenta9dccddb60913056bcadaeeacfe0395447fd2472 (diff)
TTY: fix fail path in tty_open
When tty_add_file fails we omit to clean up. Fix that by calling tty_release appropriatelly. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/tty_io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 8540f2bab9c6..55bb456e8f1c 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1894,6 +1894,7 @@ got_driver:
1894 retval = tty_add_file(tty, filp); 1894 retval = tty_add_file(tty, filp);
1895 if (retval) { 1895 if (retval) {
1896 tty_unlock(); 1896 tty_unlock();
1897 tty_release(inode, filp);
1897 return retval; 1898 return retval;
1898 } 1899 }
1899 1900