Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267362
b: refs/heads/master
c: a034070
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Oct 19, 2011
1 parent f60c0c1 commit 49ae3dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 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: 5fbe46b67680c27aeb56228dab8cfe25f8f8f83d
refs/heads/master: a0340703981baa6cc1e9c7c768095a0a4e718daf
21 changes: 12 additions & 9 deletions trunk/drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ int tty_release(struct inode *inode, struct file *filp)

static int tty_open(struct inode *inode, struct file *filp)
{
struct tty_struct *tty;
struct tty_struct *tty = NULL;
int noctty, retval;
struct tty_driver *driver;
int index;
Expand Down Expand Up @@ -1892,14 +1892,17 @@ static int tty_open(struct inode *inode, struct file *filp)
return -ENODEV;
}
got_driver:
/* check whether we're reopening an existing tty */
tty = tty_driver_lookup_tty(driver, inode, index);
if (IS_ERR(tty)) {
tty_unlock();
mutex_unlock(&tty_mutex);
tty_driver_kref_put(driver);
tty_free_file(filp);
return PTR_ERR(tty);
if (!tty) {
/* check whether we're reopening an existing tty */
tty = tty_driver_lookup_tty(driver, inode, index);

if (IS_ERR(tty)) {
tty_unlock();
mutex_unlock(&tty_mutex);
tty_driver_kref_put(driver);
tty_free_file(filp);
return PTR_ERR(tty);
}
}

if (tty) {
Expand Down

0 comments on commit 49ae3dd

Please sign in to comment.