Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Cox and committed by
Linus Torvalds
335adde6 fe9cd962

-2
-2
drivers/char/pty.c
··· 544 544 module_put(o_tty->driver->owner); 545 545 free_tty_struct(o_tty); 546 546 pty_unix98_shutdown(tty); 547 - free_tty_struct(tty); 548 - module_put(driver->owner); 549 547 return -ENOMEM; 550 548 } 551 549