From: Jiri Slaby Date: Wed, 23 Mar 2011 09:48:37 +0000 (+0100) Subject: TTY: fix fail path in tty_open X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0259894c7;p=mv-sheeva.git 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 Cc: Alan Cox Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 8540f2bab9c..55bb456e8f1 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1894,6 +1894,7 @@ got_driver: retval = tty_add_file(tty, filp); if (retval) { tty_unlock(); + tty_release(inode, filp); return retval; }