Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304216
b: refs/heads/master
c: 3af502b
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed May 4, 2012
1 parent fecb188 commit e8711f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22886ee96895b7a9f9d06da4dc9420b61b4ef1f7
refs/heads/master: 3af502b96649ccb7462da73b0cca446c8384b155
9 changes: 7 additions & 2 deletions trunk/drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,11 @@ void disassociate_ctty(int on_exit)
*/
void no_tty(void)
{
/* FIXME: Review locking here. The tty_lock never covered any race
between a new association and proc_clear_tty but possible we need
to protect against this anyway */
struct task_struct *tsk = current;
tty_lock();
disassociate_ctty(0);
tty_unlock();
proc_clear_tty(tsk);
}

Expand Down Expand Up @@ -1800,6 +1801,9 @@ int tty_release(struct inode *inode, struct file *filp)
*
* We cannot return driver and index like for the other nodes because
* devpts will not work then. It expects inodes to be from devpts FS.
*
* We need to move to returning a refcounted object from all the lookup
* paths including this one.
*/
static struct tty_struct *tty_open_current_tty(dev_t device, struct file *filp)
{
Expand All @@ -1816,6 +1820,7 @@ static struct tty_struct *tty_open_current_tty(dev_t device, struct file *filp)
/* noctty = 1; */
tty_kref_put(tty);
/* FIXME: we put a reference and return a TTY! */
/* This is only safe because the caller holds tty_mutex */
return tty;
}

Expand Down

0 comments on commit e8711f1

Please sign in to comment.