diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-07-12 19:44:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-12 20:21:47 -0400 |
commit | 07584d4a356ef52c084e1e4fedc22858ffc2f8b2 (patch) | |
tree | e9d1e2f4570ff89f9ae770c4df9e541e569533c7 /drivers/tty | |
parent | 2c964a2f4191f2229566895f1a0e85f8339f5dd1 (diff) |
drivers: tty: Fix use-after-free in pty_common_install
In 2c964a2f "drivers: tty: Merge alloc_tty_struct and
initialize_tty_struct", I messed up the refactorization of
pty_common_install, causing use-after-free and NULL pointer derefs on
various error paths. This should fix it.
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/pty.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index ac723e3c031a..9bbdb1de12e2 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c | |||
@@ -388,7 +388,7 @@ err_deinit_tty: | |||
388 | deinitialize_tty_struct(o_tty); | 388 | deinitialize_tty_struct(o_tty); |
389 | free_tty_struct(o_tty); | 389 | free_tty_struct(o_tty); |
390 | err_put_module: | 390 | err_put_module: |
391 | module_put(o_tty->driver->owner); | 391 | module_put(driver->other->owner); |
392 | err: | 392 | err: |
393 | kfree(ports[0]); | 393 | kfree(ports[0]); |
394 | kfree(ports[1]); | 394 | kfree(ports[1]); |