diff --git a/[refs] b/[refs] index abb53432110f..4a6dd34c4ec3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b5450d9c84bdd38b261922057cd167da51dfae93 +refs/heads/master: 654f562c526cf9dfb8d453f687341fe0777ee454 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 527119afb6a5..5b961eb71cbf 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -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); @@ -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; } @@ -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: @@ -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;