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.stricted.de/?a=commitdiff_plain;h=0259894c732837c801565d038eaecdcf8fc5bbe7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 8540f2bab9c6..55bb456e8f1c 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; }