pty: Fix allocation failure double free

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, October 13, 2008 - 11:03 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=335add...
Commit:     335adde689150d2fcf4df3cb26a6fc6740ed1f3e
Parent:     fe9cd962a62cb5f666cf48b9941d3f3cde134254
Author:     Alan Cox <alan@redhat.com>
AuthorDate: Mon Oct 13 10:43:48 2008 +0100
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Mon Oct 13 09:51:44 2008 -0700

    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>
---
 drivers/char/pty.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index c3ab8c3..3c6b791 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -544,8 +544,6 @@ free_mem_out:
 	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;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
pty: Fix allocation failure double free, Linux Kernel Mailing ..., (Mon Oct 13, 11:03 am)