Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175331
b: refs/heads/master
c: edfacdd
h: refs/heads/master
i:
  175329: 8d6eb77
  175327: bbb2016
v: v3
  • Loading branch information
Sukadev Bhattiprolu authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent a523d7a commit ad6d883
Show file tree
Hide file tree
Showing 2 changed files with 15 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: 68cb4f8e246bbbc649980be0628cae9265870a91
refs/heads/master: edfacdd6f81119b9005615593f2cbd94b8c7e2d8
16 changes: 14 additions & 2 deletions trunk/fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,23 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)

struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number)
{
struct dentry *dentry;
struct tty_struct *tty;

BUG_ON(pts_inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR));

/* Ensure dentry has not been deleted by devpts_pty_kill() */
dentry = d_find_alias(pts_inode);
if (!dentry)
return NULL;

tty = NULL;
if (pts_inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC)
return (struct tty_struct *)pts_inode->i_private;
return NULL;
tty = (struct tty_struct *)pts_inode->i_private;

dput(dentry);

return tty;
}

void devpts_pty_kill(struct tty_struct *tty)
Expand Down

0 comments on commit ad6d883

Please sign in to comment.