Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154118
b: refs/heads/master
c: 654f562
h: refs/heads/master
v: v3
  • Loading branch information
J. R. Okajima authored and Al Viro committed Jun 24, 2009
1 parent d7efcc3 commit 741021e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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: b5450d9c84bdd38b261922057cd167da51dfae93
refs/heads/master: 654f562c526cf9dfb8d453f687341fe0777ee454
11 changes: 10 additions & 1 deletion trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1698,8 +1698,11 @@ struct file *do_filp_open(int dfd, const char *pathname,
if (error)
return ERR_PTR(error);
error = path_walk(pathname, &nd);
if (error)
if (error) {
if (nd.root.mnt)
path_put(&nd.root);
return ERR_PTR(error);
}
if (unlikely(!audit_dummy_context()))
audit_inode(pathname, nd.path.dentry);

Expand Down Expand Up @@ -1759,6 +1762,8 @@ struct file *do_filp_open(int dfd, const char *pathname,
}
filp = nameidata_to_filp(&nd, open_flag);
mnt_drop_write(nd.path.mnt);
if (nd.root.mnt)
path_put(&nd.root);
return filp;
}

Expand Down Expand Up @@ -1819,6 +1824,8 @@ struct file *do_filp_open(int dfd, const char *pathname,
*/
if (will_write)
mnt_drop_write(nd.path.mnt);
if (nd.root.mnt)
path_put(&nd.root);
return filp;

exit_mutex_unlock:
Expand Down Expand Up @@ -1859,6 +1866,8 @@ struct file *do_filp_open(int dfd, const char *pathname,
* with "intent.open".
*/
release_open_intent(&nd);
if (nd.root.mnt)
path_put(&nd.root);
return ERR_PTR(error);
}
nd.flags &= ~LOOKUP_PARENT;
Expand Down

0 comments on commit 741021e

Please sign in to comment.