]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/tty/pty.c
tty: Fix ldisc leak in failed tty_init_dev()
[karo-tx-linux.git] / drivers / tty / pty.c
index b3110040164ae64fa29e66fae2d7f5bd4d7d139f..8cbe802bff1df50dcae99674914b925ef5495a34 100644 (file)
@@ -408,7 +408,7 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty,
                   the easy way .. */
                retval = tty_init_termios(tty);
                if (retval)
-                       goto err_deinit_tty;
+                       goto err_free_tty;
 
                retval = tty_init_termios(o_tty);
                if (retval)
@@ -447,8 +447,7 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty,
 err_free_termios:
        if (legacy)
                tty_free_termios(tty);
-err_deinit_tty:
-       deinitialize_tty_struct(o_tty);
+err_free_tty:
        free_tty_struct(o_tty);
 err_put_module:
        module_put(driver->other->owner);