Skip to content

Commit

Permalink
pty: Fix allocation failure double free
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alan Cox authored and torvalds committed Oct 13, 2008
1 parent fe9cd96 commit 335adde
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/char/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 335adde

Please sign in to comment.