From 36f1d348cb7793f56283d7137591c66f1dc9c7e6 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Thu, 15 Nov 2012 09:49:49 +0100 Subject: [PATCH] --- yaml --- r: 338417 b: refs/heads/master c: 81c79838ca24f48e0e4bb96502d131d6af758ae0 h: refs/heads/master i: 338415: 1b6cf9b69a2b0bd520d5a2e381c7bbb02f02f2a9 v: v3 --- [refs] | 2 +- trunk/drivers/tty/pty.c | 2 +- trunk/drivers/tty/tty_port.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index fbfcf974034f..23c3f1ed4fc9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7342c59a44ad9e5f30baaa2de84830f40b9f06c0 +refs/heads/master: 81c79838ca24f48e0e4bb96502d131d6af758ae0 diff --git a/trunk/drivers/tty/pty.c b/trunk/drivers/tty/pty.c index 0ce0b3ec2bb0..a541ec875932 100644 --- a/trunk/drivers/tty/pty.c +++ b/trunk/drivers/tty/pty.c @@ -408,7 +408,7 @@ static void pty_unix98_shutdown(struct tty_struct *tty) static void pty_cleanup(struct tty_struct *tty) { tty->port->itty = NULL; - kfree(tty->port); + tty_port_put(tty->port); } /* Traditional BSD devices */ diff --git a/trunk/drivers/tty/tty_port.c b/trunk/drivers/tty/tty_port.c index 416b42f7c346..fdc42c2d565f 100644 --- a/trunk/drivers/tty/tty_port.c +++ b/trunk/drivers/tty/tty_port.c @@ -128,7 +128,7 @@ static void tty_port_destructor(struct kref *kref) if (port->xmit_buf) free_page((unsigned long)port->xmit_buf); tty_buffer_free_all(port); - if (port->ops->destruct) + if (port->ops && port->ops->destruct) port->ops->destruct(port); else kfree(port);