mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-10 13:04:36 -05:00
pty: Fix allocation failure double free
The updating and moving around of the pty code added a bug where both the helper and caller free the main tty struct (the pty driver must free the o_tty pair itself however). Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -544,8 +544,6 @@ static int pty_unix98_install(struct tty_driver *driver, struct tty_struct *tty)
|
||||
module_put(o_tty->driver->owner);
|
||||
free_tty_struct(o_tty);
|
||||
pty_unix98_shutdown(tty);
|
||||
free_tty_struct(tty);
|
||||
module_put(driver->owner);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user