Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338352
b: refs/heads/master
c: 967fab6
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent f0a7c0f commit 8d0bb78
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5cff39c69b57df6d7bf4e87f2963571aa4ea6336
refs/heads/master: 967fab6916681e5ab131fdef1226327b02454f19
2 changes: 2 additions & 0 deletions trunk/drivers/tty/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty,
tty_port_init(ports[1]);
o_tty->port = ports[0];
tty->port = ports[1];
o_tty->port->itty = o_tty;

tty_driver_kref_get(driver);
tty->count++;
Expand All @@ -371,6 +372,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);
}

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,8 @@ struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx)
"%s: %s driver does not set tty->port. This will crash the kernel later. Fix the driver!\n",
__func__, tty->driver->name);

tty->port->itty = tty;

/*
* Structures all installed ... call the ldisc open routines.
* If we fail here just call release_tty to clean up. No need
Expand Down Expand Up @@ -1552,6 +1554,7 @@ static void release_tty(struct tty_struct *tty, int idx)
tty->ops->shutdown(tty);
tty_free_termios(tty);
tty_driver_remove_tty(tty->driver, tty);
tty->port->itty = NULL;

if (tty->link)
tty_kref_put(tty->link);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ struct tty_port_operations {

struct tty_port {
struct tty_struct *tty; /* Back pointer */
struct tty_struct *itty; /* internal back ptr */
const struct tty_port_operations *ops; /* Port operations */
spinlock_t lock; /* Lock protecting tty field */
int blocked_open; /* Waiting to open */
Expand Down

0 comments on commit 8d0bb78

Please sign in to comment.